Jquery Show does not work in td [closed]

0

I have the following code snippet:

$(".item2").hide();

$("#show").chick(function(){
	$(".item2").show();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script><tableborder="1">
<tr>
  <td>Item1</td>
  <td class="item2">Item2</td>
</tr>
</table>
<br/>
<input type="button" value="show" id="show" />

Notice that clicking the item2 button should be displayed, but it has not worked. Why does this occur and how do I resolve it?

    
asked by anonymous 12.04.2016 / 22:55

2 answers

3

Your error is here: $("#show").chick(function(){ "chick" correct is click .

$(".item2").hide();

$("#show").click(function(){
	$(".item2").show();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script><tableborder="1">
<tr>
  <td>Item1</td>
  <td class="item2">Item2</td>
</tr>
</table>
<br/>
<input type="button" value="show" id="show" />
    
12.04.2016 / 23:03
3

You were using .chick instead of clicking. Try it now.

$(".item2").hide();

$("#show").click(function(){
	$(".item2").show();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script><tableborder="1">
<tr>
  <td>Item1</td>
  <td class="item2">Item2</td>
</tr>
</table>
<br/>
<input type="button" value="show" id="show" />
    
12.04.2016 / 23:04