Shahrukh
Shahrukh

Reputation: 45

Javascript Function not working in Google Chrome?

function showMe(id_show_element) {
    document.getElementById(id_show_element).style.display = '';
}

Upvotes: 0

Views: 4131

Answers (2)

Akbar Attari
Akbar Attari

Reputation: 26

<script type="text/javascript">    function showNhide(val,element_id) {    if(val == 'Others')    {    document.getElementById(element_id).style.display = '';    }    else    {    document.getElementById(element_id).style.display = 'none';    }    }    </script>




<select name="degrees" onchange="showNhide(this.options[this.selectedIndex].value, 'others_details');">    <option value="">Select Degree</option>    <option value="O-Level">O-Level</option>    </select>    <span id="others_details" style="display:none">    <input type="text" name="others_degree" value="" />    </span>

Upvotes: 1

usman mehmood
usman mehmood

Reputation: 112

There should be other error in your javascript code, following is the example through which I hide the element:

    document.getElementById('dropdownListId').style.display = 'none';

to show this element I use following code

    document.getElementById('dropdownListId').style.display = '';

I think there is other javascript error in your code, please share small piece of code.

Upvotes: 0

Related Questions