javascript - how would i append dropdown html/css to jquery 1 line body -
i want append dropdown box using html/css. problem have 1 id in body, therefore don't know how this. if can post example following code posted, appreciated.
i foudn i'm not sure how set id's in code , not sure if ok.
var someelement = $('<div/>', {id: 'someid'); $('canvas').after(someelement); $('#someid').domorestuff
here code:
<head> <title>jtournament</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script src="jtournament.js"></script> <script> var matchinfo = { "rounds": [{ "name": "round1", "matches": [{ "p1": "bill", "p2": "bob", "winner": 1 }, { "p1": "sam", "p2": "duddly", "winner": 2 }, { "p1": "andy", "p2": "biff", "winner": 1 }, { "p1": "phill", "p2": "peter", "winner": 1 }, { "p1": "john", "p2": "dave", "winner": 2 }, { "p1": "xaus", "p2": "james", "winner": 2 }, { "p1": "kenny", "p2": "nick", "winner": 1 }, { "p1": "fred", "p2": "pat", "winner": 2 }] }, { "name": "round2", "matches": [{ "p1": null, "p2": null }, { "p1": null, "p2": null }, { "p1": null, "p2": null }, { "p1": null, "p2": null }] }, { "name": "round3", "matches": [{ "p1": null, "p2": null }, { "p1": null, "p2": null }] }, { "name": "round4", "matches": [{ "p1": null, "p2": null }, ] }] }; </script> </head <body> <canvas id="tournament"></canvas> </body>
i'd add dropdown menus, can connect content dynamically. thank you
you can add new element after canvas using:
$('#tournament').after('<div id="newid"></div>');
now if want add can using append() function
$('#newid').append('<select></select>');
checkout link if else required http://api.jquery.com/append/
Comments
Post a Comment