Skip to content

Latest commit

 

History

History
83 lines (48 loc) · 1.25 KB

README.md

File metadata and controls

83 lines (48 loc) · 1.25 KB

#jquery.tag.js

Function

Add a tag element.

$.tag = function(name, options){ ... }

before:

<div id="hoge">Test</div>

script:

$("#hoge")
    .tag("a", {"href": "http://example.com/", id: "home", class: "foo bar"})
        .tag("span").text("goto home").gat()
    .gat()
;

after:

<div id="hoge">
    <a href="http://example.com/" id="home", class="foo bar">
        <span>goto home</span>
    </a>
</div>

Add new tag element.

$.tagset = function(name, options) { ... }

before:

<div id="hoge">Test</div>

script:

$("#hoge")
    .tagset("a", {"href": "http://example.com/", id: "home", class: "foo bar"})
        .tag("span").text("goto home").gat()
    .gat()
;

after:

<div id="hoge">
    <a href="http://example.com/" id="home", class="foo bar">
        <span>goto home</span>
    </a>
</div>

Add a javascript.

$.next = function() { ... } script:

$("#hoge")
    .tag("a", {"href": "http://example.com/", id: "home", class: "foo bar"}).gat()
    .next(function() {
        alert("ALERT");
    })
;

Close the element tag.

$.gat = function() { ... }

License

The same license jquery.

http://jquery.org/license/