Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

change color of input if submit clicked and input is empty

HTML :
Text <input type="text">
<button>Click Me</button>
--------------------------
JQuery :
$("button").on("click",function(){
    if($("[type='text']").val() == null){
        $(this).css("border","2px solid red");
    } 
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: open menu 
Javascript :: firebase dynamic Links safari not able to open the link becuse the link is invalid 
Javascript :: replace all commas in string javascript 
Javascript :: bjsmasth delete 
Javascript :: discord.js delete commend after reply 
Javascript :: all running instances of node server 
Javascript :: instafeeed.js pulls back unknown for image file 
Javascript :: how to make kak in javascript 
Javascript :: javascript add navbar link 
Javascript :: how to show stop loading page for some second in nuxt 
Javascript :: how to clear form fields in react after submit 
Javascript :: add key to object only when there is value 
Javascript :: how to push object in array in angular from an api 
Javascript :: must line ending of word regex match 
Javascript :: react default value for props not showing up 
Javascript :: sub_total.toFixed is not a function 
Javascript :: Unable to load schema from https json SchemaStore org eslintrc 
Javascript :: await fetch data componentdidmount 
Javascript :: getting form value(s) with js 
Javascript :: Assign keys to an object with the same name 
Javascript :: CSS overflow table row positioning 
Javascript :: create serverless hello-world 
Javascript :: how do i count the number of occurrences in a string javascript 
Javascript :: return where an property eqauls 
Javascript :: modal nodejs 
Javascript :: prototip 
Javascript :: how to add types of a chance mixin 
Javascript :: Date.now beautiful human readable 
Javascript :: rest in object destructuring 
Javascript :: function return string javascript 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =