02.
<script type=
"text/javascript"
>
03.
$(document).ready(
function
() {
04.
var
rows = 1;
05.
$(
"#createRows"
).click(
function
() {
06.
var
tr =
"<tr>"
;
07.
tr = tr +
"<td><select type='text' name='txtbraind"
+ rows +
"' id='txtbrand"
+ rows +
"'></selecct></td>"
08.
tr = tr +
"<td><input type='text' name='txtproduct"
+ rows +
"' id='txtproduct"
+ rows +
"' ></td>"
;
09.
tr = tr +
"<td><input type='text' name='txtcolor"
+ rows +
"' id='txtcolor"
+ rows +
"'></td>"
;
10.
tr = tr +
"<td><select type='text' name='txtwirelength"
+ rows +
"' id='txtwirelength"
+ rows +
"'></selecct></td>"
;
11.
tr = tr +
"<td><select type='text' name='txtwiretype"
+ rows +
"' id='txtwiretype"
+ rows +
"'></selecct></td>"
;
12.
tr = tr +
"<td><input type='text' name='txtamount"
+ rows +
"' id='txtamount"
+ rows +
"'></td>"
;
13.
tr = tr +
"</tr>"
;
14.
$(
'#myTable > tbody:last'
).append(tr);
15.
$(
'#hdnCount'
).val(rows);
16.
rows = rows + 1;
17.
});
18.
$(
"#deleteRows"
).click(
function
() {
19.
if
($(
"#myTable tr"
).length != 1) {
20.
$(
"#myTable tr:last"
).remove();
21.
}
22.
});
23.
$(
"#clearRows"
).click(
function
() {
24.
rows = 1;
25.
$(
'#hdnCount'
).val(rows);
26.
$(
'#myTable > tbody:last'
).
empty
();
27.
});
28.
});