Skip to content

corbpie

Writing about interests; Web, Dev, SEO, Marketing and more!
Menu
  • Home
  • Contact

Tag: JS

January 28, 2021

Vanilla Javascript basics; Adding and removing classes

Adding and removing classes to HTML elements with vanilla Javascript. Also included is a toggle and replace method. Adding a class name to an element with classList.add() document.getElementById(“theId”).classList.add(“green-text”); Add multiple…

January 27, 2021

Vanilla Javascript basics; Selecting elements based on id or class

Doing vanilla Javascript selecting or setting elements with their id or class name. Selecting Selecting a HTML element with its id with getElementById(): document.getElementById(“theId”); Selecting an element based on the…

January 19, 2021

Setting HTML date input value

How to set the default value to a HTML date input using vanilla JS or jQuery, including a method to set the date to be 1 month from now. The…

January 14, 2021

Show & hide Bootstrap modal with jQuery

Opening and closing a Bootstrap modal using the traditional button method and then with jQuery targeting with a button click. CodePen example. Traditional way Opening (showing) the modal the traditional…

December 16, 2020

Loading Javascript files after page has finished loading

How to load a javascript file only once the page has finished loading. This is done with a document event listener that will run when the content has been fully…

December 9, 2020

Doing an Ajax call without jQuery

How to make calls without Ajax in vanilla Javascript. Using Ajax requires jQuery, whilst it is a convenience, including the whole jQuery library for just Ajax is overboard. Here is…

December 6, 2020

Live time and date with vanilla Javascript

A live and active time and date with vanilla Javascript. CodePen example. Start by setting variables for the date string: var today = new Date(); var day = today.getDate(); var…

November 9, 2020

Infinite scrolling with AJax calls

A working example for an infinite scrolling page with a Jquery Ajax request. Upon reaching the bottom of the page the Ajax call function is used to retrieve random words…

October 14, 2020

Javascript click button to copy textarea or input

How to do a button click to copy for a text box or input with HTML and a little bit of Javascript. The HTML (bootstrap): <div class=”container”> <div class=”row mt-2″>…

October 7, 2020

HTML form inputs based on a select element

Creating an HTML form that is dynamic based on what is selected. Certain form input elements will be shown based on the initial select dropdown. CodePen link. As you can…

Posts navigation

1 2 Next »

Categories

Analytics Business Computing Consumer Creative Development Fitness Gaming Managment Marketing News Photography Random SEO Sport Technology Travel Uncategorized Web Design

Tags

a6500 API App Apple Blog Bootstrap Computing CSS Dev Digital Marketing Drone FFmpeg Hosting How to HTML Internet IOS jQuery JS Lake Eppalock Linux Marketing Media MYSQL nba Online Store Photography PHP Product development Promotion SEO Server Small Business Social Media Sony alpha Ubuntu Video VPS Vultr Web Web design Web Dev Windows server Wordpress YouTube