我正在处理一个带有步骤的html表单,最后一页是一个摘要。这很好用,但现在我想显示基于 div 类而不是 div id 的值,这是因为我想多次显示该值。这是javascript:
<SCRIPT TYPE="text/javascript">
<!--
function copyText(e)
{
document.getElementById( e.name + 'preview' ).innerHTML = e.value;
}
//-->
</SCRIPT>
<script>
$("text1preview").draggable({ containment: '#dragcontainer' });
$("address1preview").draggable({ containment: '#dragcontainer' });
$("titlepreview").draggable({ containment: '#dragcontainer' });
$("zipcodepreview").draggable({ containment: '#dragcontainer' });
$("descriptionpreview").draggable({ containment: '#dragcontainer' });
$("wijkpreview").draggable({ containment: '#dragcontainer' });
$("address2preview").draggable({ containment: '#dragcontainer' });
$("tagspreview").draggable({ containment: '#dragcontainer' });
$(".catidpreview").draggable({ containment: '#dragcontainer' });
$("pricepreview").draggable({ containment: '#dragcontainer' });
</script>
这是摘要html:
<tr>
<td width="220">Samenvatting</td>
</tr>
<tr>
<td>Categorie:</td>
<td><div class="categoryid"></div></td>
</tr>
<tr>
<td>Titel van uw object:</td>
<td><div id="titlepreview"></div></td>
</tr>
<tr>
<td>Adres:</td>
<td><div id="address1preview"> </div> </td>
</tr>
<tr>
<td>Postcode</td>
<td><div id="zipcodepreview"></div></td>
</tr>
<tr>
<td>Plaats:</td>
<td><div id="address2preview"></div></td>
</tr>
<tr>
<td>Wijk:</td>
<td><div id="wijkpreview"></div></td>
</tr>
<tr>
<td>Omschrijving:</td>
<td><div id="descriptionpreview"></div></td>
</tr>
<tr>
<td>Tags:</td>
<td><div id="tagspreview"></div></td>
</tr>
<tr>
<td>Prijs per periode:</td>
<td><div id="pricepreview"></div></td>
</tr>
</table>