jQuery Live-Ready 1.0 Demo

Example Code

Initialization

	    
      $.liveReady(function () {
        // this is $(document), or the element(s) added
        var number = parseInt($('#elementCount').text());
        $('#elementCount').text(number + this.length);
      });
      
      $.liveReady('a', function () {
        // this is all 'a' in document, or all 'a' in the element(s) added
        this.css('color', 'red');
      });
      
      function addContent(){
        $('p').last().after(
          $('<p>More <a href="">links.</a></p><p>And paragraphs.</p>').liveReady()
        );
      }
	    
	    

Markup

	    
      <p>Total elements initialized: <span id="elementCount">0</span></p>
      <p>All links should be red: <a href="#">here is a link</a></p>
      <p>Click here to <a href="javascript:addContent()">add new content</p></p>
      
	    

Live Demo

Total elements initialized: 0

All links should be red: here is a link

Click here to add new content