jquery find span with Numbers and hide it -


how can second li list , find in span class "txtlist" contains numbers, , hide it?

<ul id="addresslist">      <li>title</li>      <li>         <span class="txtlist">full name</span>          <span class="txtlist">065632645454</span>      </li>         <li>         <span class="txtlist">usa</span>          <span class="txtlist">df sdfsdf g</span>      </li>   </ul> 

thank you!

concept behind is, if try convert string can convertible number not return nan while using + conversion.

try,

$('ul li:eq(1) span.txtlist').filter(function(){   return !isnan(+$(this).text()); }).hide(); 

demo


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -