Is there a way to create dom with zen coding?

191 views Asked by At

For example I want to write this JS code

$(document).ready(function() {
    var parent = $('#mydiv');
    var data = {somekey: 'Hello world!'};
    parent.append(zen('table>tr>td.someClass{somekey}', data));
});

with the following results:

<div id="mydiv">
    <table>
        <tr>
            <td class="someClass">
                Hello wolrd!
            </td>
        </tr>
    </table>
</div>

Are there any JS libraries?

2

There are 2 answers

0
lrsjng On BEST ANSWER

here's a jQuery plugin that does what you are locking for: https://github.com/zodoz/jquery-ZenCoding

0
Sjeiti On

Here's a pure js one: https://github.com/Sjeiti/zen. It's really just a wrapper for Emmet (so no unimplemented syntax issues).