+ 6

Jquery verification

I've an input with a placeholder. In jquery, I want to : if this input's placeholder == "tape here" then ... how can I do ?

29th Aug 2017, 11:24 AM
NoxFly
NoxFly - avatar
3 Answers
+ 7
var prop = $('input').prop('placeholder'); if(prop == 'something'){ //code here } //this way makes your code faster and easier to read
29th Aug 2017, 11:46 AM
Sergio Araya Villalobos
Sergio Araya Villalobos - avatar
+ 7
if($("el").attr('placeholder') == "txt") { // ... code }
29th Aug 2017, 11:32 AM
Maz
Maz - avatar
+ 5
if($('input').prop('placeholder'))=='tape here'){ }
29th Aug 2017, 11:33 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar