Example ( Set Array)
1 2 |
var cars = ["Saab", "Volvo", "BMW"]; document.getElementById("kutay").innerHTML = cars[0]; |
Example (Random variable)
1 2 3 4 |
for(var i = 0; i < 15; i++){ var ctr = Math.floor(Math.random()*opts.length); jqo.append("<div class='slot'>"+opts[ctr]+"</div>"); } |
Example ( On click change event)
1 |
<input type="radio" name="radiobutton" value="A" onClick="changeKutayContent()"> |
Example ( get content of id )
1 2 3 |
document.getElementById("content").innerHTML = "whatever"; $("field_name").update("New text"); |
Example ( Foreach value from POST form )
1 2 3 4 5 6 |
<input name="name_for_the_items[]"/> foreach($_POST['name_for_the_items'] as $item) { // do something with $item } |
D
D