Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to set button width in javascript

var buttonShort = document.createElement("button");
buttonShort.innerHTML = "Generate Short Password";

var body = document.getElementsByTagName("body")[0];

buttonShort.style.width = '200px'; // setting the width to 200px
buttonShort.style.height = '200px'; // setting the height to 200px
buttonShort.style.background = 'teal'; // setting the background color to teal
buttonShort.style.color = 'white'; // setting the color to white
buttonShort.style.fontSize = '20px'; // setting the font size to 20px

body.appendChild(buttonShort);

buttonShort.addEventListener("click", function() {
  var newWindow = window.open();
  newWindow.document.write("The generated Password is: '" + short() + "'");
  newWindow.focus();
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: wavesurf js 
Javascript :: chess game in javascript github 
Javascript :: Node.JS mongodb create database 
Javascript :: Unable to resolve "@react-native-community/masked-view" from 
Javascript :: nestjs typeorm 
Javascript :: javascript download image 
Javascript :: event.propagation not working 
Javascript :: kendo grid toolbar custom button click event jquery 
Javascript :: javascript parseint 
Javascript :: function prototype javascript 
Javascript :: array.splice javascript 
Javascript :: remove object property javascript es6 
Javascript :: vue font awesome icons 
Javascript :: convert data image url into an image file 
Javascript :: vue js get routes 
Javascript :: javascript map function 
Javascript :: javascript for...of with Strings 
Javascript :: overflowx 
Javascript :: material ui 
Javascript :: how to convert decimal to roman in javascript 
Javascript :: nuxt 3 font awesome 
Javascript :: javascript Set Difference Operation 
Javascript :: Javascript number Count up 
Javascript :: vue js link image link in props doesnt work 
Javascript :: javascript split 
Javascript :: google places autocomplete empty latitude 
Javascript :: javascript tostring 
Javascript :: target child event 
Javascript :: how to find a name of class from page in jquery 
Javascript :: get keys of object js 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =