Hello everybody,

can any one please tell me how to disable the <div>. I have got the id of <div>.I
have tried $(divID).style.display = "block" and "none". But of no use
can any one please help me


Recommended Answers

All 2 Replies

can you post some of your code...
or try this example:
this will disable text box,select box by using div id..

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript">
function toggleAlert() {
function toggleDisabled(el) {
try {
el.disabled = el.disabled ? false : true;
if (el.childNodes && el.childNodes.length > 0) {
for (var x = 0; x < el.childNodes.length; x++) {

<div id="content">
<td><input type="text" name="foo" /></td>
<select name="bar">
<input type="checkbox" value="toggleAlert()" onclick="toggleAlert()" />

or use this line insted of your posted line:

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

you can also add with this

document.getElementById('divID').style.visiblity = 'hidden';
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.