Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- Mouseover and Click - Selecting cells from tables


Fotiman - 3:43 pm on May 9, 2012 (gmt 0)


As pointed out, don't reuse ID values. ID's are unique.

Change this line:

content += "<tr><td id='inv'>" + val.invno + "</td><td>" + val.vendor + "</td><td>" + val.date + "</td></tr>";


To this:


content += "<tr><td class='inv'>" + val.invno + "</td><td>" + val.vendor + "</td><td>" + val.date + "</td></tr>";


Then change this:

$('#rbox').on("click", "#invTbl td#inv", function (e) {


To this:

$('#rbox').on("click", "#invTbl td.inv", function (e) {


And this:

$('#rbox').on("mouseover", "#invTbl td#inv", function (e) {


To this:


$('#rbox').on("mouseover", "#invTbl td.inv", function (e) {


And this:


$('#rbox').on("mouseout", "#invTbl td#inv", function (e) {


To this:


$('#rbox').on("mouseout", "#invTbl td.inv", function (e) {


Thread source:: http://www.webmasterworld.com/javascript/4449892.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com