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>