如何使用节点在文本框中设置值?
var tot = parseFloat(parseFloat(shortageval) - parseFloat(singval)).toFixed(3);
$($this).parents('tr').prevAll('tr').find('id=sishr11').innerhtml=tot;
请帮忙。
答案 0 :(得分:0)
我认为这可以帮助你...
<?php
$doc = new DOMDocument();
$doc->load( 'sample1.xml' );
$musiclist = $doc->getElementsByTagName( "song" );
foreach( $musiclist as $song )
{
$artists = $song->getElementsByTagName( "artist" );
$artist = $artists->item(0)->nodeValue;
}
?>
<input type="text" id="artist" name="artist" value="<?php echo $artist; ?>"tabindex="1"/>
这是XML Sample.xml
<?xml version="1.0" encoding="utf-8"?>
<musiclist>
<song>
<title></title>
<artist></artist>
<url></url>
</song>
</musiclist>