61
rated 0 times
[
66]
[
5]
/ answers: 1 / hits: 18900
/ 11 Years ago, tue, april 23, 2013, 12:00:00
I'm struggling to find the correct syntax for adding a button via javascript/jquery that has a function attached.
Right now I am trying:
list.append(<button onclick='getFeed('http://open.live.bbc.co.uk/weather/feeds/en/PA2/3dayforecast.rss, showFeedResults')'>ButtonTest</button>);
But it returns:
<button onclick=getFeed( http:= open.live.bbc.co.uk= weather= feeds= en= pa2= 3dayforecast.rss,= showfeedresults')'=>ButtonTest</button>
Essentially, I want to be able to create
<button onclick=getFeed('http://open.live.bbc.co.uk/weather/feeds/en/B1/3dayforecast.rss', showFeedResults) class=ui-btn-hidden>
In javascript, But can't figure out how..`
And I seem to be having trouble wrapping my head around creating html elements that use both single and double qoutation marks.
Any advice would be greatly appreciated.
More From » jquery