javascript - Avoid jquery function for all the content -


i have table 20 rows. in each row there element

<p class="exp-date">'.$cust->expiration_date.'</p> 

this element going repeated , return different values in lot of rows return 0001-01-01. want hide content wrote in javascript

var exp = $(".exp-date").val();   var exphide = '0001-01-01';     if(exp = exphide) {         $(".exp-date").html('');     } 

and have tried this

$('.exp-date').each(function() {         if(exp = exphide) {             $(".exp-date").html('');         }     }); 

but in both cases apply jquery on first row , modify not statement declared.

someone idea?

thanks in advance

use == , "this", else point classes. code shown below

    var exphide = '0001-01-01';     $('.exp-date').each(function() {         if(this.innerhtml == exphide) {  //this.innerhtml             $(this).html('');  //this.html..else point classes         }     }); 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -