I am creating an image in jQuery like this but the border attribute doesn’t seem to work… Is my syntax wrong?
var img =
$('<img>', {
'title': 'Event (Event '+wavy_counter+')',
'class': 'listed_event',
'id': 'wavy_event_'+wavy_counter+'',
'data-count': ''+wavy_counter+'',
'src': 'final_tutorial_buttons/wavy.png',
'height': '50',
'width': '50',
'border': 'solid',
'border': '2px',
'border': 'red',
'onclick': 'highlight.call(this);',
'data-start': '',
'data-end': ''
});
I get a border but is black instead of red.
I think it should be:
It’s been a long time I don’t use the “native” HTML
borderattribute, but I think it only sets the border thickness. To define all the properties you want, you need CSS, hence thestyleattribute.