How do I extract a background= value from a string containing HTML in JavaScript?

Posted by bbeckford on Stack Overflow See other posts from Stack Overflow or by bbeckford
Published on 2010-05-21T16:20:03Z Indexed on 2010/05/21 17:00 UTC
Read the original article Hit count: 169

Filed under:
|

I have a string containing HTML loaded from another page, how do I extract the background property from it's body tag using Javascript?

The body tag in the string looks like this:

<body onload='init();' background='storage/images/jsb_background.jpg' link='#000000' vlink='#000000' alink='#000000' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>

Thanks!

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery