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 :: electron Uncaught ReferenceError: require is not defined 
Javascript :: = meaning in javascript 
Javascript :: react 18.2 
Javascript :: JavaScript (rhino 1.7.9) sample 
Javascript :: id multiple same property array combining 
Javascript :: how to sort linesin javascript 
Javascript :: pimcore 
Javascript :: arjs marker+location 
Javascript :: why null is an object in javascript 
Javascript :: javascript prevent more than one click 
Javascript :: what f a number exceeding 2^53 in javascript 
Javascript :: javascript Create Objects: Constructor Function Vs Object Literal 
Javascript :: javascript rest parameter 
Javascript :: creating js classes 
Javascript :: javascript Using yield to Pause Execution 
Javascript :: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object. 
Javascript :: salesforce set hours javascript 
Javascript :: how to convert a title to a url slug in jquery 
Javascript :: How to get prime numbers using for loop in Js 
Javascript :: maximum product of word lengths leetcode solution 
Javascript :: phaser 60 fps animation test 
Javascript :: get lat long react native 
Javascript :: JAVASCRIPT CHEATSHEET 1 
Javascript :: nodejs stream pipeline with custom transform 
Javascript :: sadd in redis 
Javascript :: jquery selectors 
Javascript :: disable input field javascript 
Javascript :: add google map in react js 
Javascript :: react native smart splash screen 
Javascript :: tofixed in javascript 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =