I have the following markup
<td>
<a id="lbtnDelete" onclick="deleteFile(this); return false;" runat="server" class="silverbutton smallbutton normal">
<span class="left">
<span class="right">Delete</span>
</span>
</a>
<asp:HiddenField runat="server" ID="hidDownloadId" />
</td>
function deleteFile(element)
{
var currEl = element;
var downloadId = currEl.next().value;
}
When user clicks “lbtnDelete” link I call deleteFile(this) function. In this function I should get the value of the hidden input – hidDownloadId. How can I do it? I’ve already tried
currEl.next().value;
but in Chrome i got an error like “Object doesn’t have method next()”. Enother attempt was to do
currEl.parent().find('[type=hidden]')
[Exception: TypeError: Object has no method 'parent']
Any help would be greatly apprecitated.
You need to create jquery object out of your element before you can use jquery methods on it..
But since you go the jquery way, you should also stop using inline event attributes and use jquery for the binding as well..
So
and