html-dom

JavaScript, loop all selects?

Well im new to javascript but why does this not work, all i want to do is to get a list of all selects on the page. var elements = document.getElementsByTagName("select"); alert("there are " + elements.length + " select's"); for (i = 0; i < elements.length; i++) { alert(elements[i].getAttribute('Id')); } Edit: the error is that it...

How do I disable all input buttons without using jQuery?

How would I do this without jQuery? $('input[type=submit]').attr('disabled',true); It doesn't have to be cross-browser compatible; a solution that only works in Firefox is OK. ...

selected text position

How can I get the co-ordinates of selected text in Javascript ? ...

Need guidance for HTML-dom designing ..

I have started with the project where I am suppose to use client side scripting @ extreme. this is the scenario : There are two drop-down lists in my form on my web-page ..one is COUNTRY and other is STATE. The drop-down list STATE must be disabled untill One of the values in Country is selected and According to the value selected in dr...

HTML file: add annotations through IHTMLDocument

I need to add "annotations" to existing HTML documents - best in the form of string property values I can read & write by name. Apparently (to me), meta elements in the header seem to be the common way - i.e. adding/modifying elements like <head> <meta name="unique-id_property-name" content="property-value"/> ... </head> Questio...

Adobe Air with HTML DOM

How do I use Adobe Air with HTML DOM? "<input type="text" class="inputtext" name="myemail" id="email" tabindex="1">" I tried document.getElementById('email').value = "[email protected]"; document.getElementById('myemail').value = "[email protected]"; It doesn't work ReferenceError: Error #1069: Property getElementById not found on Main...

php: Parse string from html

I have opend a html file with file_get_contents('http://www.example.com/file.html') and want to parse the line "ParseThis": <h1 class=\"header\">ParseThis<\/h1> As you can see the it's within a h1 tag (the first h1 tag from the html file). How can I get the Text "ParseThis" ? Thanks! ...

How to iterate through ul list using Javascript?

I have the following HTML page (page is simplified here as it is a sample of the real one): <html> <head> <script type="text/javascript" src="JavaScript/Painting.js"></script> </head> <body> <div id="center-wrapper"> <div id="side-menu"> <ul> <li><a onclick="Paint()">About</a></li> <li><a onclick="Pa...

Get list item index in HTML ul list using Javascript

I have the following HTML page: <html> <head> <script type="text/javascript" src="JavaScript/Menu.js"></script> </head> <body> <ul> <li><a onclick="GetIndex(this)">One</a></li> <li><a onclick="GetIndex(this)">Two</a></li> <li><a onclick="GetIndex(this)">Three</a></li> ...