-
Book Overview & Buying
-
Table Of Contents
Mastering LOB Development for Silverlight 5: A Case Study in Action
By :
Now, let's check how to go deeper and handle the DOM object and access the properties of a given HTML element.
From the HtmlPage object, an instance of the HtmlDocument object can also be obtained. With the HtmlDocument object, it is possible to:
Search for page elements (by name, class, or type), via the GetElementById and GetElementByTagName methods
Access the list of the URL parameters
Obtain the cookies
When we search for a page element via the HtmlDocument object, we obtain an HtmlElement object. This class provides a series of methods which make it possible to handle the DOM objects. Nevertheless, unless it is strictly necessary, it would be more advisable to modify the HTML objects of the page making use of its own language, JavaScript:
Access/modify the properties of the HTML elements via the GetProperty and SetProperty methods
Access/modify the attributes of the HTML elements via the GetAttribute and SetAttribute methods
Access/modify...
Change the font size
Change margin width
Change background colour