Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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);
        }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: Duplicate module name: React Native hasteimpl react native android 
Javascript :: unobtrusive validation on selectpicker 
Javascript :: quasar composition api $q 
Javascript :: measure width in px chrome extension 
Javascript :: three js buffergeometry raycasting face site:stackoverflow.com 
Javascript :: how to detect if app is loosing focuse in react native 
Javascript :: single node elasticsearch with enable security basic in docker 
Javascript :: what is reveal.js plugin 
Javascript :: iron_to_nugget.json 
Javascript :: test 
Javascript :: jstree select all visible node only 
Javascript :: guardar en una variable la peticion ajax 
Javascript :: Programação web com Node e Express Beneficiando-se da stack JavaScript 
Javascript :: append rotated triangle in anchor tag 
Javascript :: Angular watching for changes in $http.pendingRequests from directive 
Javascript :: javascript path folder above 
Javascript :: if you run a script.js with the code, how do you access the value passed to "var" inside script.js ... 
Javascript :: dom-to-image bad quality 
Javascript :: parsley validation checkbox alignment 
Javascript :: js return undefined on ReferenceError 
Javascript :: javascript requestanimationframe stack overflow 
Javascript :: receiving big response node js 
Javascript :: window.initMochaPhantomJS(); 
Javascript :: format string of names 
Javascript :: most common use cases of portals in react 
Javascript :: parse ipv6 address using json 
Javascript :: react native application architecture 
Javascript :: id condition with ngfor in angular 10 
Javascript :: how to display data from json api using flutter expansiontile 
Javascript :: hoe lang is 50000 uur 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =