Is there a way to create dom with zen coding?
-
14-07-2021 - |
Question
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?
Solution
here's a jQuery plugin that does what you are locking for: https://github.com/zodoz/jquery-ZenCoding
OTHER TIPS
Here's a pure js one: https://github.com/Sjeiti/zen. It's really just a wrapper for Emmet (so no unimplemented syntax issues).
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow