@@ -578,7 +578,7 @@ <h4>Output:</h4>
578578<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
579579<!--~~~~~~~~~~~~~~~~~~ 06. Geeks4Geeks in green, DOM select in JavaScript in red ~~~~~~~~~~~~~~~-->
580580< p align ="center " >
581- < a href =""
581+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a0c-76d2-77de-8fb5-d9b140c651d3 "
582582 target ="_blank " rel ="noopener noreferrer ">
583583 < img class ="displayed "
584584 src ="./images/image006.png?raw=true "
@@ -631,7 +631,7 @@ <h4>Output:</h4>
631631<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
632632<!--~~~~~~~~~~~~ 07. first paragraph in green, 2nd in blue, centered, 60px from top ~~~~~~~~~~~~-->
633633< p align ="center " >
634- < a href =""
634+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a0c-76d2-77de-8fb5-d9b140c651d3 "
635635 target ="_blank " rel ="noopener noreferrer ">
636636 < img class ="displayed "
637637 src ="./images/image007.png?raw=true "
@@ -685,7 +685,7 @@ <h4>Output:</h4.
685685<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
686686<!--~~~~~~~~~~~~ 08. Geeks4Geeks in green, centered, 30px from margin, 30px in size ~~~~~~~~~~~~-->
687687< p align ="center " >
688- < a href =""
688+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a10-0251-74d1-adda-143743783632 "
689689 target ="_blank " rel ="noopener noreferrer ">
690690 < img class ="displayed "
691691 src ="./images/image008.png?raw=true "
@@ -740,7 +740,7 @@ <h4>Output:</h4>
740740<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
741741<!--~~~~~~~~~~~~~~~~~~~~~~~ 09. how to select dom element using tag name ~~~~~~~~~~~~~~~~~~~~~~~-->
742742< p align ="center " >
743- < a href =""
743+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a10-0251-74d1-adda-143743783632 "
744744 target ="_blank " rel ="noopener noreferrer ">
745745 < img class ="displayed "
746746 src ="./images/image009.png?raw=true "
@@ -812,7 +812,7 @@ <h4>Output:</h4>
812812<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
813813<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~ 10. click to get all ids in an array ~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
814814< p align ="center " >
815- < a href =""
815+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a10-0251-74d1-adda-143743783632 "
816816 target ="_blank " rel ="noopener noreferrer ">
817817 < img class ="displayed "
818818 src ="./images/image010.gif?raw=true "
@@ -880,7 +880,7 @@ <h4>Output:</h4>
880880<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
881881<!--~~~~~~~~~~~~~~~~~~~~~~~ 11. click to get/display all ids in an array ~~~~~~~~~~~~~~~~~~~~~~~-->
882882< p align ="center " >
883- < a href =""
883+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a13-68ce-7a88-870c-df992c440067 "
884884 target ="_blank " rel ="noopener noreferrer ">
885885 < img class ="displayed "
886886 src ="./images/image011.gif?raw=true "
@@ -954,7 +954,7 @@ <h4>Output:</h4>
954954<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
955955<!--~~~~~~~~~~~~~~~~~ 12. click to get/display attributes for target elements ~~~~~~~~~~~~~~~~~~-->
956956< p align ="center " >
957- < a href =""
957+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a15-4bb7-7e90-b9bb-9f8ea163d394 "
958958 target ="_blank " rel ="noopener noreferrer ">
959959 < img class ="displayed "
960960 src ="./images/image012.gif?raw=true "
@@ -1015,7 +1015,7 @@ <h4>Output:</h4>
10151015<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
10161016<!--~~~~~~~~~~~~~~~~~ 13. click to get/display attributes for target elements ~~~~~~~~~~~~~~~~~~-->
10171017< p align ="center " >
1018- < a href =""
1018+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a20-cb92-788f-8b52-5ce15f93e2a9 "
10191019 target ="_blank " rel ="noopener noreferrer ">
10201020 < img class ="displayed "
10211021 src ="./images/image013.gif?raw=true "
@@ -1110,7 +1110,7 @@ <h4>Output:</h4>
11101110<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
11111111<!--~~~~~~~~~~~~~~~ 14. get/display elements by class name, number of elements ~~~~~~~~~~~~~~~~~-->
11121112< p align ="center " >
1113- < a href =""
1113+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a21-ce53-7eeb-a964-718cba0cae2b "
11141114 target ="_blank " rel ="noopener noreferrer ">
11151115 < img class ="displayed "
11161116 src ="./images/image014.png?raw=true "
@@ -1175,7 +1175,7 @@ <h4>Output</h4>
11751175<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
11761176<!--~~~~~~~~~~~~ 15. get/display elements by class name, each element reformatted ~~~~~~~~~~~~~~-->
11771177< p align ="center " >
1178- < a href =""
1178+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a23-c2b1-7f89-ab5a-35c21971a1a1 "
11791179 target ="_blank " rel ="noopener noreferrer ">
11801180 < img class ="displayed "
11811181 src ="./images/image015.png?raw=true "
@@ -1244,7 +1244,7 @@ <h4>Output:</h4>
12441244<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
12451245<!--~~~~~~~~ 16. get/display elements by class name, display contents of each element ~~~~~~~~~~-->
12461246< p align ="center " >
1247- < a href =""
1247+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a24-a92d-7ff8-81cb-35f5c6a744ac "
12481248 target ="_blank " rel ="noopener noreferrer ">
12491249 < img class ="displayed "
12501250 src ="./images/image016.png?raw=true "
@@ -1315,7 +1315,7 @@ <h4>Output:</h4>
13151315<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
13161316<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 17. Get/display classname value ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
13171317< p align ="center " >
1318- < a href =""
1318+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a25-849a-7cf8-9820-be93f02b00d0 "
13191319 target ="_blank " rel ="noopener noreferrer ">
13201320 < img class ="displayed "
13211321 src ="./images/image017.gif?raw=true "
@@ -1377,16 +1377,16 @@ <h4>Example 2: In this example, we will get the second element by class name.</h
13771377<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
13781378< h4 > Output:</ h4 >
13791379<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
1380- <!--~~~~~~~~~~~~~~~~~~~~~~~ 18. query selector all example ~~~~~~~~~~~~~~~~-->
1380+ <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 18. query selector all example ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~-->
13811381< p align ="center " >
1382- < a href =""
1382+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a2e-fec4-7560-959f-2dc8deaa4ae7 "
13831383 target ="_blank " rel ="noopener noreferrer ">
13841384 < img class ="displayed "
13851385 src ="./images/image018.gif?raw=true "
13861386 loading ="lazy "
13871387 style ="width:40%; "
1388- title =""
1389- alt =". " />
1388+ title ="Example 2: In this example, we will get the second element by class name "
1389+ alt ="Example 2: In this example, we will get the second element by class name . " />
13901390</ a >
13911391</ p >
13921392<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
@@ -1441,16 +1441,16 @@ <h4>Example: This example shows the extraction of the domain name from a URL.</h
14411441<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
14421442< h4 > Output:</ h4 >
14431443<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
1444- <!--~~~~~~~~~~~~~~~~~~~~~~~ 33. ~~~~~~~~~~~~~~~~-->
1444+ <!--~~~~~~~~~~~~~~~~~~~~~~~ 33. Get Domain Name From URL in JavaScript ~~~~~~~~~ ~~~~~~~~~~~~~~~~-->
14451445< p align ="center " >
1446- < a href =""
1446+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a39-c80f-78c0-af2a-8449ce90324c "
14471447 target ="_blank " rel ="noopener noreferrer ">
14481448 < img class ="displayed "
14491449 src ="./images/image033.png?raw=true "
14501450 loading ="lazy "
14511451 style ="width:40%; "
1452- title =""
1453- alt =". " />
1452+ title ="Example: This example shows the extraction of the domain name from a URL "
1453+ alt ="Example: This example shows the extraction of the domain name from a URL . " />
14541454</ a >
14551455</ p >
14561456<!-- image033.png -->
@@ -1480,16 +1480,16 @@ <h4>Example: This example demonstrates the extraction of the domain name using R
14801480<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
14811481< h4 > Output:</ h4 >
14821482<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
1483- <!--~~~~~~~~~~~~~~~~~~~~~~~ 34. ~~~~~~~~~~~~~~~~-->
1483+ <!--~~~~~~~~~~~~~~~~~~~ 34. Example: Extraction of domain name using RegeX ~~~~~ ~~~~~~~~~~~~~~~~-->
14841484< p align ="center " >
1485- < a href =""
1485+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a3c-3762-7632-a465-def04639ed89 "
14861486 target ="_blank " rel ="noopener noreferrer ">
14871487 < img class ="displayed "
14881488 src ="./images/image034.png?raw=true "
14891489 loading ="lazy "
14901490 style ="width:40%; "
1491- title =""
1492- alt =". " />
1491+ title ="This example demonstrates the extraction of the domain name using Regex "
1492+ alt ="This example demonstrates the extraction of the domain name using Regex . " />
14931493</ a >
14941494</ p >
14951495<!-- image034.png -->
@@ -1584,33 +1584,33 @@ <h4>Output:</h4>
15841584 < li > < b > Before</ b > Clicking the button:</ li >
15851585</ ul >
15861586<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
1587- <!--~~~~~~~~~~~~~~~~~~~~~~~ 35. ~~~~~~~~~~~~~~~~-->
1587+ <!--~~~~~~~~~~~~~~~~~ 35. Example: get protocol, domain and port URL using JS ~~ ~~~~~~~~~~~~~~~~-->
15881588< p align ="center " >
1589- < a href =""
1589+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a3e-da5d-7a8d-9e3a-5e7bdfd6b6e5 "
15901590 target ="_blank " rel ="noopener noreferrer ">
15911591 < img class ="displayed "
15921592 src ="./images/image035.png?raw=true "
15931593 loading ="lazy "
15941594 style ="width:40%; "
1595- title =""
1596- alt =". " />
1595+ title ="Example: Get protocol, domain and port from URL using JavaScript "
1596+ alt ="Example: Get protocol, domain and port from URL using JavaScript . " />
15971597</ a >
15981598</ p >
15991599<!-- image035.png -->
16001600< ul >
16011601 < li > < b > After</ b > Clicking the button:</ li >
16021602</ ul >
16031603<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
1604- <!--~~~~~~~~~~~~~~~~~~~~~~~ 36. ~~~~~~~~~~~~~~~~-->
1604+ <!--~~~~~~~~~~~~~~~~~~~~~~~ 36. Example: get protocol, domain and port URL using JS ~~~~~~~~~~~~~~~~-->
16051605< p align ="center " >
1606- < a href =""
1606+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a3e-da5d-7a8d-9e3a-5e7bdfd6b6e5 "
16071607 target ="_blank " rel ="noopener noreferrer ">
16081608 < img class ="displayed "
16091609 src ="./images/image036.png?raw=true "
16101610 loading ="lazy "
16111611 style ="width:40%; "
1612- title =""
1613- alt =". " />
1612+ title ="Example: get protocol, domain name, and port URL using JavaScript "
1613+ alt ="Example: get protocol, domain name, and port URL using JavaScript . " />
16141614</ a >
16151615</ p >
16161616<!-- image036.png -->
@@ -1698,7 +1698,7 @@ <h4>Output:</h4>
16981698<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
16991699<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 37. get protocol, domain, and port from url ~~~~~~~~~~~~~~~~~~~-->
17001700< p align ="center " >
1701- < a href =""
1701+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a44-d37b-749e-8f09-ea4a45347a9d "
17021702 target ="_blank " rel ="noopener noreferrer ">
17031703 < img class ="displayed "
17041704 src ="./images/image037.png?raw=true "
@@ -1714,7 +1714,7 @@ <h4>Output:</h4>
17141714<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
17151715<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 38. get protocol, domain, and port from url ~~~~~~~~~~~~~~~~~~~-->
17161716< p align ="center " >
1717- < a href =""
1717+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a44-d37b-749e-8f09-ea4a45347a9d "
17181718 target ="_blank " rel ="noopener noreferrer ">
17191719 < img class ="displayed "
17201720 src ="./images/image038.png?raw=true "
@@ -1787,7 +1787,7 @@ <h4>Output:</h4>
17871787<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
17881788<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~ 39. g4g - listing url and hostname ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
17891789< p align ="center " >
1790- < a href =""
1790+ < a href ="https://codepen.io/editor/BBauska/pen/019e2a46-16d0-74ec-a434-43b1b7a5d7a6 "
17911791 target ="_blank " rel ="noopener noreferrer ">
17921792 < img class ="displayed "
17931793 src ="./images/image039.png?raw=true "
@@ -1934,8 +1934,8 @@ <h2 id="D12">12. How to get URL Parameters using JavaScript?</h2>
19341934< h4 > Table of Content</ h4 >
19351935<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
19361936< ul >
1937- < li > < a href ="#D12-01 "> 01. Using the URLSearchParams Object</ li >
1938- < li > < a href ="#D12-02 "> 02. Separating and accessing each parameter pair</ li >
1937+ < li > < a href ="#D12-01 "> 01. Using the URLSearchParams Object</ a > </ li >
1938+ < li > < a href ="#D12-02 "> 02. Separating and accessing each parameter pair</ a > </ li >
19391939</ ul >
19401940<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
19411941< h3 id ="D12-01 "> Method 1: Using the URLSearchParams Object</ h3 >
0 commit comments