Skip to content

Instantly share code, notes, and snippets.

@ironchefpython
ironchefpython / weld-ideas.md
Created June 30, 2011 17:29
Idioms for updating properties with weld

Here are the options I've thought about for attribute update syntax


Option 1. Certain types of html elements where the most common use case is attribute update, such as <img>, <iframe>, <input>, <link>, <object>, <param>... and <a> update the logical attribute by default.

    $('<a id="target" href="http://yahoo.com"><span id="text">Yahoo</span></a>')
        .weld({target:'http://google.com', text: 'Google'});