<!DOCTYPE html><html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <title>Check whether a control exists</title> </head>
<body>
<script type="text/javascript">
function check() { if (document.getElementById('btn_yasser')) { alert('Exists !'); } else { alert('Not present'); } }
</script>
<input type="button" id="btn_yasser" value="click me" onClick="check();" />
</body>
</html>The same could be used for ASP controls. Hope this helps.
Monday, April 25, 2011
Check whether a HTML control exists or not
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment