I'm trying to create a simple way to pull information from a custom HTML attribute when I have multiple buttons to click with the same 'id'.
I'd like to know if I can pass the 'url' attribute value from the specific button I press. Right now, it always just grabs the first one...
Code:
<script>
$(document).ready(function() {
$(":input[id='alarm']").click(function() {
alert($("input[url]").attr("url"));
});
});
</script>
<table id='alarms'>
<th>ID</th>
<th>CaseID</th>
<th>Alarm</th>
<tr>
<td width="50">2040</td>
<td width="180">TEST-111110-123-R4</td>
<td><input id="alarm" type="button" value="Cancel" url="../silencealarm.php?id=2040"></td>
</tr>
<td width="50">2042</td>
<td width="180">TEST-111110-123-R6</td>
<td><input id="alarm" type="button" value="Cancel" url="../silencealarm.php?id=2042"></td>
</tr>
</table>