This option will reset the home page of this site. Restoring any closed widgets or categories.

Reset

DOM elements dynamically using our JAVASCRIPT

DOM elements
Dynamically using our JAVASCRIPT
JAVASCRIPT

function AddItem()
{
// Create an Option object

var opt = document.createElement(’option’);

// Add an Option object to Drop Down/List Box
document.getElementById(”DropDownList”).options.add(opt);
var Text =prompt(”Enter Your Name”);

var Value =’addingsongs.php’
var Name = ‘data’;

// Assign text and value to Option object
opt.text = Text;
opt.setAttribute(’name’, Name);
opt.value = Value;

}

HTML CODE

<select id=”DropDownList” name=”selectbox” >

</select>

<input type=”button” onClick=”AddItem()” value=”tutorialz.tk” />


The above code actually means that there is a select box and a button in our HTML page.When we click our button the fuction Additem()is called and a prompt box appears, give the name as you wish and that name is dynamically added to our select box simple……ANY QUERIES MAIL ME

VN:F [1.5.7_846]
Rating: 0.0/10 (0 votes cast)
VN:F [1.5.7_846]
Rating: 0 (from 0 votes)

Related posts:

  1. Password protect pages using javascript
  2. Get textbox value from dropdown using ajax and php

Leave a Reply

Comments (required)

Spam Protected