javascript - Why slide up doesn't work if I use ul tag? -


i want pull up/slide html "p" tag when page has been loaded.

this jquery code works fine , that:

$(function () {     $('.graybgc').slideup(0); }); 

html:

<p class="graybgc">     <span>a: </span>abcd..... </p> 

but when put tags ul, doesn't works , doesn't pull html p tag.

 <p class="graybgc">        <span>a: </span>           <ul >             <li>123</li>              <li>123</li>           </ul> </p> 

you cannot put ul tag inside of p tag. please check html specification.

here working example using div tag (jsfiddle: https://jsfiddle.net/hulothe/sa09gu46/) :

$('.graybgc').on('click', function() {      $(this).slideup(0);  });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <div class="graybgc" >      <span>a: </span>      <ul>          <li>123</li>          <li>123</li>      </ul>  </div>


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -