Check If a String Contains Only Numbers in Javascript

In this blog post, we learn how to check or validate a string containing only numbers. Often this validation is used to validate the phone number. 1. First Method using RegExp \D To validate I am using RegExp \D Metacharacter. The \D metacharacter matches non-digit characters. “isNum” variable returns a true or false. Result 2. Second Method using … Read more

Remove Non Alphanumeric in Javascript

In this post, We learn how to remove Non-alphanumeric characters from a string in javascript. What are non alphanumeric characters? Non-alphanumeric characters are those characters or kinds of symbols. Such as exclamation mark(!), at symbol(@), commas(, ), question mark(?), colon(:), dash(-) etc and special characters like dollar sign($), equal symbol(=), plus sign(+), apostrophes(‘). 1. Using \w Metacharacter … Read more

How to Make a Keylogger in Javascript?

In this blog post, I share simple javascript code to make Keylogger in Javascript. This simple Js code will record keystrokes from the user on the website page and write a log on log.txt. index.php javascript.js Don’t fotget to add domain in server. We would get the final result like this. log.txt

How to Design Facebook Login Page in HTML and CSS

Facebook is the largest social media platform in the world. It keeps updating its design and features continuously. The login page of Facebook looks very attractive. In this blog post, I am sharing the HTML and CSS code of the Facebook login page with you. HTML CSS add some style

Download Image from URL in PHP

In this post, I share simple code to download and view images from URLs in PHP. HTML Create a simple HTML form PHP We have used file_get_contents() method here. file_get_contents() is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by your OS to … Read more

Categories PHP

Disable or Enable Multiple Inputs Fields on Button Click

In this blog post, We learn to Disable or Enable multiple Inputs Fields on Button Click. In this example we use querySelectorAll() and disable property to enable and disable input field, querySelectorAll() returns a static (not live) NodeList representing a list of the document’s elements that match the specified group of selectors. The disabled property sets or … Read more

Confirm Delete on Button Click in Javascript

confirm delete button work, If the user selects ‘Ok‘ then href redirect to ” url_to_delete “, else if ‘Cancel‘ is clicked nothing happens. Method 1 The confirm() method displays a dialog box with a specified message, along with an OK and a Cancel button. Method 2 create a button with a function name ” ConfirmDelete … Read more

Get Last Day of the Month in Javascript

Get Last Day of Month in Javascript

In this blog post, we get the last day of a given month in javascript. Creates a JavaScript Date instance that represents a single moment in time in a platform-independent format. Date objects contain a Number that represents milliseconds since 1 January 1970 UTC. Javascript Result Syntax I hope it will help you.