Figure out when an empty "table cell" jQuery prefix problems
Posted: Wed Oct 08, 2014 3:07 am
So after some research I figured I would try this as it would seem like the best bet:
http://api.jquery.com/attribute-contain ... -selector/
The actual page: www.orpgcreator.com/3blocks/board.php
I am trying to figure out when and which top column is clicked.
http://api.jquery.com/attribute-contain ... -selector/
The actual page: www.orpgcreator.com/3blocks/board.php
I am trying to figure out when and which top column is clicked.
Code: Select all
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript">
$( "[id|='click_']" ).click(function(){
var str = $( this ).attr( "id" );
var the_id = str.replace("click_", "");
alert(the_id);
});
</script>
<table height="100%" width="100%" border="1">
<?
for($x = 1; $x < 8; $x++)
{
?>
<tr id="click_<?= $x ?>">
<?
for($y = 1; $y < 7; $y++)
{
?>
<td id="<?= $x . '-' . $y ?>"></td>
<?
}
?>
</tr>
<?
}
?>
</table>