Created
December 27, 2012 21:31
-
-
Save bruinbrown/4392171 to your computer and use it in GitHub Desktop.
Manipulating the DOM with Blade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Dom; | |
using System.Html; | |
namespace BladeTest | |
{ | |
public class BladeExample | |
{ | |
public BladeExample() | |
{ | |
Document doc = window.document; //Retrieve the document from the window | |
var elem = doc.getElementById("test"); //Find the element which has the ID 'test' | |
if(elem!=null) //Ensure that we're not trying to assign to an element which doesn't exist | |
{ | |
elem.textContent = "Hello World!"; //Set the content of the element to be | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment