<!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8" /> <link href="App_Themes/test.css" rel="stylesheet" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script> $(function () { $('#sect1').click(function () { }); }); </script> </head> <body> <div class="header"> <ul class="ul-menu"> <li class="li-menu"><a href="SECTION1.html" id="sect1" onclick="check()">Section 1</a></li> <li class="li-menu"><a href="SECTION2.html" id="sect2" target="_parent">Section 2</a></li> <li class="li-menu"><a href="SECTION3.html" id="sect3">Section 3</a></li> <li class="li-menu"><a href="SECTION4.html" id="sect4">Section 4</a></li> <li class="li-menu"><a href="SECTION5.html" id="sect5">Section 5</a></li> <li class="li-menu"><a href="validateform.html" id="sect6">Section 6</a></li> </ul> </div> <div id="content" name="con"> <div class="left"> </div> <div class="right"> </div> </div> <div class="footer"> </div>
body { } * { margin:0px; padding:0px; } .header { height:70px; width:100%; background-color:brown; } .left { float:left; height:500px; width:10%; background-color:burlywood; } .right { float:right; height:500px; width:10%; background-color:burlywood; } .footer { height:70px; width:100%; clear:both; background-color:brown; } .ul-menu { list-style-type:none; } .li-menu,a { float:left; text-decoration:none; font-size:large; margin-top:10px; margin-left:10px; padding-left:10px; color:yellow; } .li-menu, a:hover { text-decoration:underline; }
<!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8" /> <script> // alert(checkbox); // if (confirm("Are U Sure Want To Delete") == true) // { // var i = r.parentNode.parentNode.rowIndex; // document.getElementById("tbl").deleteRow(i); // } // else { alert("Ok"); } //} function addrow(row) { var name = prompt("Enter Name "); var table = document.getElementById("tbl"); var row = table.insertRow(); var cell1 = row.insertCell(0); var cell2 = row.insertCell(1); var cell3 = row.insertCell(2); cell1.innerHTML = "<input type='checkbox' name='foo'/>"; cell2.innerHTML = name; cell3.innerHTML = "<input type='button' value='delete' onclick='delRow(this)' >"; } //function selectall(source) { // var checkboxes = document.getElementsByName("foo"); // for (var i = 0, n = checkboxes.length; i < n; i++) { // if (checkboxes[i].type == 'checkbox') // { // checkboxes[i].checked = true; // } // else { // checkboxes[i].checked = false; // } // } //} function deleteall(source) { var checkboxes = document.getElementsByName("foo"); for (var i = 0, n = checkboxes.length; i < n; i++) { if (checkboxes[i].type == 'checkbox') { checkboxes[i].checked = true; } } if (checkboxes[i].checked == true) { // alert("You select all"); var ans = confirm("Are U Sure Delete Whole Record"); if (ans == true) { var i = source.parentNode.parentNode.rowIndex; document.getElementById("tbl").deleteRow(i); } else { alert("Sorry Tray Again!...."); } } } function delRow(r) { if (confirm("Are U Sure Want To Delete") == true) { var checkbox = document.getElementById("ch"); if (checkbox.type == 'checkbox') { if (checkbox.checked == true) { alert("Ok"); var i = r.parentNode.parentNode.rowIndex; document.getElementById("tbl").deleteRow(i); } else { alert("Sorry"); } } } } </script> </head> <body> <center> <INPUT type="button" value="Add Row" onclick="addrow('tbl')" /></center> <br /> <table border="1" align="center" id="tbl"> <tr> <th><input type="checkbox" onclick="return deleteall(this)" /></th> <th>Name</th> <th>Action</th> </tr> <tr> <td><input type="checkbox" align="center" id="ch" name="foo" /></td> <td>viral</td> <td><input type="button" id="del" value="delete" onclick="delRow(this)" /></td> </tr> <tr> <td><input type="checkbox" align="center" id="ch" name="foo" /></td> <td>vivek</td> <td><input type="button" id="del" value="delete" onclick="delRow(this)" /></td> </tr> <tr> <td><input type="checkbox" align="center" id="ch" name="foo" /></td> <td>ram</td> <td><input type="button" id="del" value="delete" onclick="delRow(this)" /></td> </tr> </table> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)