Hi,
I was trying to iterate through a collection of objects and was trying to set an attribute for each of the object.
Here is the code:
$(document).ready(function()
{
$('#clickButton').click(function()
{
var hiddenVal = $('#hdnVal').val();
$('*').find('*[tabindex]').each(function(index)
{
//this.setAttribute('tabindex', hiddenVal + this.getAttribute('tabindex'));
$(this).attr('tabindex', 'test');
});
});
});
I could not set the attribute with $(this).attr('', '');
but the JavaScript way works fine. How can I do it in jQuery?