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: Docs

EasyHTMLTags documentation.

.tag( arguments ) Returns: String

Description: Creates a tag from the arguments.

  • .tag( tag )

    tagAn empty tag element.

  • .tag( tag, content )

    tagThe tag element.

    contentThe content for the tag.

  • .tag( tag, content, attr )

    tagThe tag element.

    contentThe content for the tag.

    attrA hash with the attributes for your tag.

  • .tag( tag, content, attr, function )

    tagThe tag element.

    contentThe content for the tag.

    attrA hash with the attributes for your tag.

    functionA callback that can return more HTML to allow easy nesting (see examples).

  • .tag( tag, attr, function )

    tagThe tag element.

    attrA hash with the attributes for your tag.

    functionA callback that can return more HTML to allow easy nesting (see examples).

  • .tag( tag, function )

    tagThe tag element.

    functionA callback that can return more HTML to allow easy nesting (see examples).

Examples:

Examples: Creates some HTML in a variety of ways.


						$.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>"

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


						$.tag("li", function() { return $.tag("span", "some extra stuff")})
						# =>  "<li><span>some extra stuff</span></li>"
					



.t( arguments ) Jquery Object: String

This method is a wrapper around .tag() that returns a jQuery object instead of a String. All arguments are identical