open source projects

by Flvorful.com

EasyHTMLTag

download docs

Latest news

Nov 2: new version of SuperInPlaceControls plugin released with support for Rails 2.1 and 2.3. Also added better jquery support and validation support

Links:

jQuery Easy HTML Tag: Overview

EasyHTMLTags is a jquery plugin designed to make creating HTML elements painless. It was inspired by Rails' content_tag and is very simple to use.

Usage

1. Download the plugin and install into the appropriate directory.

2. Link to the plugin from your HTML

	<script src="/path/to/javascripts/jquery.easy_html.js" type="text/javascript" charset="utf-8"></script>

3. Start creating tags

	$.tag("li")
	# =>  "<li></li>"
	
	$.tag("li", "some content")
	# =>  "<li>some content</li>"
	
	$.tag("li", "some content", { class: "my_class", id: "special_id"})
	# =>  "<li class="my_class" id="special_id">some content</li>"
	
	$.tag("li", "some content", { class: "my_class", id: "special_id"}, function() { return $.tag("span", "some extra stuff")})
	# =>  "<li class="my_class" id="special_id">some content<span>some extra stuff</span></li>"

That's it!

See docs for more details