evaluable-tag
0.0.8 • Public • Published evaluable-tag
The tag has evaluable attribute and it behaves like annotation to next sibling.
install
npm install evaluable-tag
usage
in browser
<script src="browser/et.js"></script>
<script>
var ET = require('evaluable-tag');
</script>
in browserify
var ET = require('evaluable-tag');
ET.evalBy
html
<span class="et" data-eval="1 + 2">sum</span>
javascript
var evaluated = ET.evalBy('.et');
var et = evaluated[0];
console.log(et.result);
console.log(et.annotation.textContent);
console.log(et.annotated.textContent);
ET.evalAnnotationsBy
html
<span class="et-a" data-eval="1 + 2">sum</span>
<div>content</div>
javascript
var annotated = ET.evalAnnotationsBy('.et-a');
var et = annotated[0];
console.log(et.result);
console.log(et.annotation.textContent);
console.log(et.annotated.textContent);
The .et-a
element visibility become hidden after calling evalAnnotationsBy
.
Versions
Current Tags
- VersionDownloads (Last 7 Days)
- 0.0.8
1
Version History
Package Sidebar
Install
Weekly Downloads