Skip to main content

Bug Tracker

Side navigation

Ticket #5130: jquery-show.html
File jquery-show.html, 0.9 KB (added by DanTheMan, August 27, 2009 11:55AM UTC)

Testcase: hide() , after(), show() makes inline element to block-level element.

<html>
<head>
<script type="text/javascript" src="jquery-1.3.2.js"></script>
<script type="text/javascript">
function hide_it() {
  $("input[type='text']").hide()
}
function show_it() {
  $("input[type='text']").show()

}

$(document).ready(function() {

  var input1 = document.createElement("input");
  input1.type = "text";
  input1.name = "name1";
  input1.value = "value1";
  $("#id1").after( "test1" );
  $("#id1").after( input1 );
  $(input1).hide();
  $(input1).show();

  var input2 = document.createElement("input");
  input2.type = "text";
  input2.name = "name2";
  input2.value = "value2";
  $("#id2").after( "test2" );
  $(input2).hide();
  $("#id2").after( input2 );
  $(input2).show();

});

</script>
</head>
<body>
<h1>Hide/Show Demonstration</h1>
<h2>add element</h2>
<p id="id1"></p>
<h2>hide, add, show element</h2>
<p id="id2"></p>
<p>
<b>Bug:</b>
This input element has <b><tt>display:block;</tt></b> set.
</body>
</html>

Download in other formats:

Original Format