Generally, the jQuery toggle() method is used to show and hide the HTML element on the web page. But if you don’t want to use the jQuery library, the toggle effect can be easily added using JavaScript. Using JavaScript you can check the visibility of an element and show/hide the HTML element based on their visibility.

By: CodexWorld Feb 28, 2019

The placeholder displays a short hint of the expected value of an input field. It helps the user to know about the format of the input before enting a value. Using the placeholder attribute, you can add a placeholder text to HTML input field. The placeholder text color can be changed using the ::placeholder selector in CSS.

By: CodexWorld Feb 25, 2019

When you want the full name input from the user, the input value must be checked whether the user provides a valid name (first name and last name). Using JavaScript, the full name validation can be easily implemented in the form to check whether the user provides their first name and last name. Use JavaScript test() method with Regular Expression to validate first name and last name.

By: CodexWorld Apr 15, 2023

When you working with the image dimensions, it’s always recommended to get the real width and height of the image. The naturalWidth and naturalHeight property provide an easy way to retrieve the original dimensions of the image using JavaScript. You can easily get the original size (width and height) of the image using JavaScript.

By: CodexWorld Feb 18, 2019
PHP

Saving image from URL is very useful when you want to copy an image dynamically from the remote server and store in the local server. The file_get_contents() and file_put_contents() provides an easiest way to save remote image to local server using PHP. The image file can be saved straight to directory from the URL. You can also use cURL to save an image from URL using PHP.

By: CodexWorld Feb 13, 2019

The window.onload event is very useful when you want to call a JavaScript function on page load without using jQuery. Generally, $( document ).ready() is used to execute the JavaScript code after Document Object Model (DOM) is ready. You can use the window.onload event to call and execute a JavaScript function on page load without using jQuery.

By: CodexWorld Feb 7, 2019
PHP

The file_exists() function in PHP, is used to check if a file or directory exists on the server. But the file_exists() function will not usable if you want to check the file existence on the remote server. The fopen() function is the easiest solution to check if a file URL exists on a remote server using PHP. You can also use cURL to check if a URL exists on the remote server.

By: CodexWorld Oct 2, 2023
PHP

Stripping query parameter is very useful when you want to create a URL dynamically based on some conditions. The preg_replace() function is the easiest way to remove a specific parameter and its value from URL query string using PHP. PHP preg_replace() function searches string for matches to pattern and replace with the replacement. Use preg_replace() with REGEX to remove parameter from query string using PHP.

By: CodexWorld Jun 17, 2023

When you use LIKE operator to search and fetch the matched results from the database, the records are selected based on their entry. In LIKE search, the results must be sorted based on the word matches to make the result-set more relevance. Use ORDER BY keyword with LIKE to sort results by the best match in MySQL.

By: CodexWorld Jan 8, 2019
keyboard_double_arrow_up