Skip to content

Instantly share code, notes, and snippets.

@bruinbrown
Created December 27, 2012 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bruinbrown/4392171 to your computer and use it in GitHub Desktop.
Save bruinbrown/4392171 to your computer and use it in GitHub Desktop.
Manipulating the DOM with Blade
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