Quick and dirty MochiKit tag alias functions in jQuery
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

jQuery MochiKit tags

This plugin is a quick and dirty implementation of MochiKit's simple tag creation aliases.


Quick usage

To create:

<div id="formContainer">
	<form id="myForm">
		<input type="text" name="firstName" placeholder="First Name"/>
		<input type="text" name="lastName" placeholder="Last Name"/>
	</form>
</div>

You might write:

<script type="text/javascript">
	$.FORM(
		{"id": "myForm"},
		$.INPUT({
			"type": "text",
			"name": "firstName",
			"placeholder": "First Name"
		}),
		$.INPUT({
			"type": "text",
			"name": "lastName",
			"placeholder": "Last Name"
		}),
		$.INPUT({
			"type": "submit",
			"value": "Submit"
		})
	).appendTo('#formContainer');
</script>