10.02.2014 Views

Beginning Ajax With ASP.NET (2006).pdf

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Using the innerHTML Property<br />

Introduction to DHTML<br />

A very handy feature of and elements that first showed up in IE4 is the innerHTML property.<br />

This represents what the browser considers to be the actual HTML it will use to present the contents<br />

of the or . Although the innerHTML property is not officially a part of the World Wide<br />

Web Consortium (W3C) standard, it is still very useful, especially for <strong>Ajax</strong> — useful enough that it was<br />

also adopted by Netscape starting in version 6 of their browser.<br />

Figure 2-6<br />

Try It Out<br />

Using the innerHTML Property<br />

To get a quick idea of what it can do, you can put a on your page with and elements inside, and after the , a button to present a pop-up showing what<br />

the browser sees inside the innerHTML of the . Here’s the code:<br />

<br />

<br />

<br />

<br />

<br />

23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!