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.

<script type="text/javascript" src="jquery-1.3.2.js"></script>
<script type="text/javascript">
function hide_it() {
function show_it() {


$(document).ready(function() {

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

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


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

Download in other formats:

Original Format