tags:

views:

29

answers:

2

I'm trying at this:

var cur_border = $('id_grid_pic_'+cur_id).attr('border');
alert(cur_border);

But the alert sends back "object". I am wanting to get the value of the border=1 attribute of an image.

+1  A: 

attr returns HTML attributes. Since you're after the css value, you should replace attr with css:

var cur_border = $('id_grid_pic_'+cur_id).css('border');
alert(cur_border);
RenderIn
oh no not the css. not css in the title. I want the border attribute that looks like this : <a href=""> <img src="image.gif" border=1></a>
+2  A: 

Try this

var cur_border = $('#id_grid_pic_'+cur_id).attr('border');
alert(cur_border);

If you are using an id selector then there should be a # in front of the id.

rahul
thank you solved