JS & Node

Remove Table Rows & Cells In Javascript (Simple Examples)

Welcome to a quick tutorial on how to remove HTML table rows and cells in Javascript. Need to dynamically update a table? Remove table rows and cells in Javascript? To remove table rows and cells in Javascript: Get the table itself – var table = document.getElementById(“TABLE-ID”); The rows can be removed using the deleteRow() function

Remove Table Rows & Cells In Javascript (Simple Examples) Read More »

Copy-Cut-Paste In Javascript (Simple Clipboard Examples)

Welcome to a quick tutorial on how to copy, cut, and paste with Javascript. The Stone Age of the Internet is long over, and yes, we can use Javascript to access the user’s clipboard. Use navigator.clipboard.writeText(“TEXT”) to copy a block to text into the clipboard. var txt = document.getElementById(“TEXT-FIELD”).value; navigator.clipboard.writeText(txt); Use navigator.clipboard.readText() to access the

Copy-Cut-Paste In Javascript (Simple Clipboard Examples) Read More »

Get URL Parts In Javascript (Host, Path, File, Query, ETC…)

Welcome to a tutorial on how to get the full URL and parts in Javascript. Need to extract certain parts of the URL? Here are some of the common ones: Use location.href to get the full URL. For example – http://site.com/path/file.html?key=value Use location.origin to get the protocol and hostname. For example – http://site.com/ Use location.pathname

Get URL Parts In Javascript (Host, Path, File, Query, ETC…) Read More »