Get Width & Height of Image using Javascript before Uploading it (When you onchange on INPUT element)

You can get the width and height of the image in Javascript easily. Simply you need to use onchange event of Javascript on input[type=file]. Steps:- Create a blob URL of the uploaded file. Then create a HTML5 new Image() object, set BLOB url to its src. Apply onload event on new Image() object. So, you … Read more

parseInt() function in Javascript | HEX to RGB Color Code

This function converts the hex color value in RGB color format. (Hex code: #00ff08) The first two letters (00) in hex code represent for red color, the middle two letters (ff) are for green color and the last two letters (08) represent for blue color. Use parseInt() function to produce RGB value from HEX. Its … Read more

firstChild & lastChild Properties in JavaScript

These firstChild and lastChild both are HTML element properties in Javascript. In Html documentation, the first child element must be written just after its parent element without breaking the line (or without pressing the ‘enter’). Otherwise, you will see an empty result as the first child element’s value. We use firstChild property when we want … Read more