javascript - creating image tag in html and adding css -


i creating image in jquery border attribute doesn't seem work... 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 border black instead of red.

i think should be:

'style': 'border: 2px solid red', 

it's been long time don't use "native" html border attribute, think sets border thickness. define properties want, need css, hence style attribute.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -