Changing dropdownlist value inside table cell using javascript

Changing dropdownlist value inside table cell using javascript

In the below example we can change the selected index value inside table cell drop down down list using pure javascript. 


<!DOCTYPE html>
function displayResult()
var phraseTable = document.getElementById("myTable");
var comrow = phraseTable.rows[0];
var comrow1 = phraseTable.rows[1];

<table id="myTable" border="1">
<select class="selection">
<option value=1>hyderabad</option>
<option value=2>Bangalore</option>
<option value=3>London</option>
<option value=4>US</option>
    <td>cell 2</td>
    <td>cell 3</td>
    <td>cell 4</td>
<button type="button" onclick="displayResult()">Show number of cells in first row</button>


Share this post :

Post a Comment

Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.

Support : Ranga Rajesh Kumar
Copyright © 2012. ASP.NET Examples - All Rights Reserved
Site Designed by Ranga Rajesh Kumar