Speaking of yesterday’s post, it had the following problems: 1. It could not easily be embedded into an existing page. 2. It could not be placed wherever we wanted it to be nor it could be aligned or styled easily. 3. Rather than updating the same number to countdown it showed a series of numbers as countdown proceeded. Well all these problems can easily be solved by one of JavaScript’s powerful method getElementById() . This is documents ’s method which can be used to access HTML entities within JavaScript with the help of their IDs (which is unique). For example we can access the HTML entity and its values etc. with the ID one as: document.getElementById("one") The HTML object may be defined like below: <p id="one">some text</p> You get! OK, how can this be used to solve our problems, let’s see. As we know, the HTML entities such as <p>,<div>, <span> etc. can be plac...
A resource for learning PHP, HTML, CSS, JavaScript, C++, etc.