js increment safety value html
function addRow(tableID) {
var table = document.getElementById(tableID);
var rowCount = document.getElementById(tableID).getElementsByTagName('tbody')
[1].getElementsByTagName('tr').length;
var row = table.insertRow(rowCount +1);
var cell1 = row.insertCell(0);
var element1 = document.createElement("input");
element1.type = "hidden";
element1.name = "Q[]";
element1.value = rowCount +1;
cell2.appendChild(element1);
cell2.innerHTML = rowCount +1;
}
function deleteRow(tableID) {
try {
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
for(var i=0; i<rowCount; i++) {
var row = table.rows[i];
var chkbox = row.cells[0].childNodes[0];
if(null != chkbox && true == chkbox.checked) {
table.deleteRow(i);
rowCount--;
i--;
}
}
}catch(e) {
alert(e);
}
}
Also in JavaScript:
- constructors javascript
- javascript get element by id
- angular back button
- body-parser node
- distinguishing positive numbers in javascript
- react-data-table-component api action button
- import dropdown react
- get actual url in variable
- petition the lord with prayer
- Javascript get element height and width
- nodejs hello world
- javascript tabs example
- c# print object to json
- jquery validator driving license
- react js date ago
- typed js
- using shortid in react lists
- how to create a new react native project
- switch in react
- nodejs console.log
- js access sql database on server
- jquery timer
- react native map array of objects
- take out decoration from link react