Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

disable button without losing value

$('button[type="submit"]').each(function() {
  if ($(this).val()) {
    	$(this).addClass('disabled');
    } else {
    	$(this).prop('disabled', true);
  }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: go to line in webstorm 
Javascript :: silk carousel jquery 
Javascript :: auto refresh database in outsystems reactive 
Javascript :: compass in react js 
Javascript :: isnumber javascript function 
Javascript :: Remove a class when the backspace-key is pressed inside the input field 
Javascript :: zgadfgad 
Javascript :: Factorial while loop reverse in javascript 
Javascript :: ist to gmt javascript 
Javascript :: Fibonacci perticular position in javascript 
Javascript :: javascript pdf 
Javascript :: radio button in react native expo 
Javascript :: Search specific products in the array in javascript 
Javascript :: Import Bootstrap to React Redux CRUD App 
Javascript :: break object pair into array in js 
Javascript :: Check for particular values in the response body 
Javascript :: nodejs express use streams 
Javascript :: how to do multi ban discord.js 
Javascript :: moment js get dd/mm/yyyy 
Javascript :: cannot Nesting classes sass nextjs 
Javascript :: "create a chatbot using javascript only" 
Javascript :: double bitwise not shorthand javascript 
Javascript :: alert(document.cookie); 
Javascript :: print each word in a string javascript 
Javascript :: Sending e-mail using Mandrill API 
Javascript :: resource route or crud routs 
Javascript :: VM360:1 Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 
Javascript :: check stored jwt expiration 
Javascript :: Get physical path in javascript 
Javascript :: typeorm caching queries time limit 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =