//Get the value from a form
tmp=$('input[name=devices]:checked', '#devicesformid').val() //To
tmp=$('input[name=devices]:checked').val()
//change all elements with class .bg-red to have a red background $('.bg-red').css({"background-color":"red"});
//POST
$.post("Scenarios.php", {setActi:"", sel:code}, function(data){ if(data!=""){ alert(data); } //window.open("Scenarios.php", "_self"); document.location.reload(); });
<html> <head> <script type="text/javascript" src="jquery.min.js"></script> <script> function modTable(){ $('#testTable').html(""); alert("OK"); } </script> </head> <body> <table id=testTable> <tr><th>Prova</th></tr> <tr><td>Data</td></tr> </table> <button onclick='modTable();'>Test</button> </body> </html>