Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to change link href with javascript

document.getElementById("foo").href="newPage.php";
Comment

change href javascript

<!DOCTYPE HTML>
<html>

<body>
	<a id="myLinkId" href="abc.com" >Auto update href</a>

	<script>
		var findlink = document.getElementById("myLinkId");
		findlink.href = "xyz.com";
	</script>

</html>
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to convert seconds in hours minutes and seconds js 
Javascript :: jquery validator add method 
Javascript :: remove last element from array javascript 
Javascript :: element.classname javascript 
Javascript :: AWS JavaScript SDK node 
Javascript :: cubic root javascript 
Javascript :: beautify console log result 
Javascript :: moment js npm 
Javascript :: •“In React, everything is a component.” Explain 
Javascript :: jquery get all value from class 
Javascript :: react conditional class 
Javascript :: how to check whether a string contains a substring in javascript 
Javascript :: vue js routue push 
Javascript :: add two numbers in javascript 
Javascript :: react router base url 
Javascript :: javascript on uncaught exception 
Javascript :: change the position of div using javascript 
Javascript :: print whole array javascript 
Javascript :: iso 8601 date to Js date 
Javascript :: removeeventlistener click 
Javascript :: how to give css style in javascript 
Javascript :: CocoaPods could not find compatible versions for pod "React/Core": In Podfile: react-native-fetch-blob (from `../node_modules/react-native-fetch-blob`) was resolved to 0.10.6, which depends on React/Cor 
Javascript :: js array.prototype.join 
Javascript :: jquery from object to queryselector 
Javascript :: jquery select the 3rd row of a table 
Javascript :: sequelize get where 
Javascript :: tsconfig build only files and not src 
Javascript :: find text in label jquery 
Javascript :: vscode shortcut to search for file 
Javascript :: remove first and last element from array javascript and seprated by comma 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =