Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

check if input has value javascript

var myInput = document.getElementById("customx");
if (myInput && myInput.value) {
  alert("My input has a value!");
}
Comment

how to check if input field has value

function check(){
  var checkInput = document.getElementById("inputName");
  if (checkInput.value) {
    checkInput.classList.remove("is-invalid");
  } else {
    checkInput.classList.add("is-invalid");
  }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: comments in json 
Javascript :: chart.js chart is not defined 
Javascript :: jquery growl cdn 
Javascript :: redux devtools 
Javascript :: upload and read json file javascript 
Javascript :: how to get last item in array javascript 
Javascript :: onchange js 
Javascript :: javascript iterate over divs 
Javascript :: javascript allow only numeric characters 
Javascript :: angular {{}} new line 
Javascript :: reverse string js 
Javascript :: ngmodel angular 
Javascript :: convert cookies to json javascript 
Javascript :: fetch 
Javascript :: install node on ubuntu and debian 
Javascript :: javascript check if file exists on server 
Javascript :: convert string to number javascript 
Javascript :: jsx render array 
Javascript :: javascript get value 
Javascript :: js strict mode 
Javascript :: javascript loop through child elements 
Javascript :: move element jquery 
Javascript :: nodejs array buffer to buffer 
Javascript :: toggle class onscroll hook react 
Javascript :: window bind load jquery 
Javascript :: value change event jquery 
Javascript :: javascript currency number format indonesia 
Javascript :: dangerouslySetInnerHTML 
Javascript :: array vowels 
Javascript :: js sting first letter 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =