_hyperscript
_hyperscript copied to clipboard
[Bug] show does not seem to work
The following code
<style>
li > span { display:none }
</style>
<script type="text/hyperscript">
def showElement (Element)
set *display of Element to 'inline-block'
end
init
show #span_with_id
show .css-class
show <span[name="element-name"]/>
log 'completed'
end
</script>
<body>
If everything works as intended, the following list elements should not be empty:
<br> <br>
<ul>
<li><span id="span_with_id">this line was found by its HTML id</span></li>
<li><span class="css-class">this line was found by its CSS class</span></li>
<li><span name="element-name">this line was found by a CSS query</span></li>
</ul>
</body>
does not show the referenced list elements - however, if you use showElement instead of show, everything works fine (i.e., the references themselves are working)
A live example can be found here
Oh... the bug is that show assumes elements start as visible and are hidden by hide. As a workaround, you should be able to specify show #span_with_id with display:inline-block
Thanks for marking it as a bug