I work on a durandal project. I have span and button elements in html. The span elements are hidden and I want to show these on button click. My problem is that when I hide the span from html- it can't show it from javascript. I saw this question (on link change visibility of label tag using jquery) and I tried all of the answers- nothing helped me.
(I tried using: in html:
<span id="mySpan" hidden = "hidden">aaa</span>
or:
<span id="mySpan" style= "visibility:collapse">aaa</span>
or:
<span id="mySpan" style= "display:none">aaa</span>
in javascript:
$("#mySpan").show();
or:
$("#mySpan").css('visibility', 'visible');
I tried all of the optional combinations )
Note: I want you to know that when I'm not hiding the span from the HTML, and try using toggle()
, hide()
, show()
- it works well.
Example that does not work:
on html page:
<span id="mySpan" hidden = "hidden">aaa</span>
on javascript page:
$("#mySpan").show();