1

Hi I'm trying to get this

$( "<div class=\"images\ style=\"background:url('" + item.link + "')no-repeat top center;\"/>").appendTo("#images").wrap("<a target=\"_blank\ href='" + item.link + "'></a>");

to output correctly but I'm not very hot on concatenating javascript strings. It's the line background div I can't get right.

cheers

Andy

1 Answer 1

1

Try

$( "<div class='images' style='background:url(" + item.link + ")no-repeat top center;'/>").appendTo("#images").wrap("<a target='_blank' href=" + item.link + "></a>");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.