I cloned an html tablo with jQuery. And while clonning, jQuery also clonned radiobutton's name property and now i can just click one radiobutton when i try it with browser. How can i change name property for each clonned table?
<html>
<head>
<title> html table clonning</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
});
function clonetable () {
$("#table1").clone().appendTo("#div1");
}
</script>
</head>
<body>
<input type="button" id="button1" name="clonner" value="clone table" onclick="clonetable()" />
<br /><br />
<div id="div1">
<table border="1" id="table1">
<tr>
<td colspan="5">Question text will be here</td>
</tr>
<tr>
<td><input type="radio" id="A" name="ans" />answer1 <br /></td>
<td><input type="radio" id="B" name="ans" />answer2 <br /></td>
<td><input type="radio" id="C" name="ans" />answer3 <br /></td>
<td><input type="radio" id="D" name="ans" />answer4 <br /></td>
<td><input type="radio" id="E" name="ans" />answer5 <br /></td>
</tr>
</table>
</div>
</body>
</html>

New Topic/Question
Reply


MultiQuote




|