$(document).ready(function()
{
$(":input").focusout(function () {
var a= $(this).closest("tr").attr('id');
var b= $(this).closest("td").attr('id');
var c = $(this).attr("value");
$.post("database.php", { trAdress:a , tdAdress:b, value:c});
});
});
could this code work only between <div i="bab"> </div> tags…
I think you really need to read about jQuery and how it works .. i suggest you start here
http://docs.jquery.com/How_jQuery_Works
In your code this line :
is a selector
$(':input')– which selects part of the DOMand a method
focusout– the method performs an action on the selected element, in your case adds an event listener. You can select just about anything on the DOM … read this section of the docsIf you have the following HTML (or something like it)
you could use
$('#bab :input')as your selector (descendant selector) – this would get allinputelements within thedivwith an id ofbab(#means use the id selector)