I want to change the color of any input on the page with a value of "--Select--". The following code works on blur:
setTimeout(() => { $(document).ready(function () { $('input').blur(function() { if ($(this).val().indexOf('Select') !== -1) { $(this).css('color', '#6D6E71'); } }); }); }, 500); But since I want to change color of any input with the value "--Select--" on page load, I changed the code to:
setTimeout(() => { $(document).ready(function () { if ($('input').val().indexOf('Select') !== -1) { $(this).css('color', '#6D6E71'); } }); }, 500); This code doesn't work. Why not? How should I change it so it will work? Any help will be appreciated.