Scenario: When my web page load automatically search with cell has been input by user and have value. If has been input the table background color will red else will green.Assume this table has not been input yet. The table background green like this
and source-code of table:\[code\] <table width="1023" height="200" border="1"> <tr> <th colspan="2" scope="col">A1</th> <th colspan="2" scope="col">A2</th> <th colspan="2" scope="col">A3</th> </tr> <tr> <td bgcolor="#00CC00"><div class="data" align="center" value="http://stackoverflow.com/questions/15831040/A1.4"><input type="button" onclick="popup_window_show('#sample', { pos : 'tag-right-down', parent : this, width : '270px' });setvalue(this.value);" value="http://stackoverflow.com/questions/15831040/A1.4" /></td> <td bgcolor="#00CC00"><div class="data" align="center" value="http://stackoverflow.com/questions/15831040/A1.8"><input type="button" onclick="popup_window_show('#sample', { pos : 'tag-right-down', parent : this, width : '270px' });setvalue(this.value);" value="http://stackoverflow.com/questions/15831040/A1.8" /></td> <td bgcolor="#00CC00"><div class="data" align="center" value="http://stackoverflow.com/questions/15831040/A2.4"><input type="button" onclick="popup_window_show('#sample', { pos : 'tag-right-down', parent : this, width : '270px' });setvalue(this.value);" value="http://stackoverflow.com/questions/15831040/A2.4" /></td> <td bgcolor="#00CC00"><div class="data" align="center" value="http://stackoverflow.com/questions/15831040/A2.8"><input type="button" onclick="popup_window_show('#sample', { pos : 'tag-right-down', parent : this, width : '270px' });setvalue(this.value);" value="http://stackoverflow.com/questions/15831040/A2.8" /></td> <td bgcolor="#00CC00"><div class="data" align="center" value="http://stackoverflow.com/questions/15831040/A3.4"><input type="button" onclick="popup_window_show('#sample', { pos : 'tag-right-down', parent : this, width : '270px' });setvalue(this.value);" value="http://stackoverflow.com/questions/15831040/A3.4" /></td> <td bgcolor="#00CC00"><div class="data" align="center" value="http://stackoverflow.com/questions/15831040/A3.8"><input type="button" onclick="popup_window_show('#sample', { pos : 'tag-right-down', parent : this, width : '270px' });setvalue(this.value);" value="http://stackoverflow.com/questions/15831040/A3.8" /></td> </tr> </table>\[/code\]i use ajax.jquery to check cell value like this\[code\] var htmlobjek; $(document).ready(function () { var i = $("td").find("td.data").val(); $.ajax({ url: "cek.php", data: "i", cache: false, success: function (data) { $("#cek").val(data); } }); });\[/code\]of course in cek.php will like this\[code\]<?php$posisi = $_POST;$val = mssql_num_rows(mssql_query("SELECT*FROM tblTrnProduct WHERE Posisi = '$posisi'"));echo"$val";?>\[/code\]to get the output of cek.php. I use a little trick.I make a \[code\]<input id="cek" name="cek" type="text" />\[/code\]as a mirror.After that I manipulate table background with this javascript\[code\] $(document).ready(function () { $("#cek").change(function () { var cek = $("#cek").val(); if (cek === 0) { $("td").style("bgcolor", "#00CC00");//green else { $("td").style("bgcolor", "#FF0000");//red } } }); });\[/code\]but nothing happen after user input the data by popup form. Any idea that can help this problem with an example will more appreciate.