here’s a pure Javascript alternative:
var mydiv = document.getElementById("myDiv");
var aTag = document.createElement('a');
aTag.setAttribute('href',"yourlink.htm");
aTag.innerText = "link text";
mydiv.appendChild(aTag);
More Related Contents:
- javascript change element from another page
- javascript show intro animation, then website
- How to pass arguments to addEventListener listener function?
- How to send an email from JavaScript
- Choosing and activating the right controls on an AJAX-driven site
- How to pass parameters using ui-sref in ui-router to controller
- Callback after all asynchronous forEach callbacks are completed
- How can I custom-format the Autocomplete plug-in results?
- VueJS: why is “this” undefined?
- Merging or Combining two onEdit trigger functions
- Prevent zoom cross-browser
- Intercepting call to the back button in my AJAX application
- Setting innerHTML vs. setting value with Javascript
- How can I generate an apk that can run without server with react-native?
- Onclick event not firing on jsfiddle.net [closed]
- Why do I need to copy an array to use a method on it?
- Attach a body onload event with JS
- Upload base64 image with Ajax
- JavaScript string with new line – but not using \n
- Catch all unhandled javascript promise rejections
- Creating Rooms in Socket.io
- jQuery AJAX Call to PHP Script with JSON Return
- Optimized merge sort faster than quicksort
- Is this a good way to clone an object in ES6?
- image.onError event never fires, but image isn’t valid data – need a work around
- Refresh iFrame (Cache Issue)
- Selecting elements without jQuery
- JavaScript Callback after calling function
- In JavaScript, how can I replace text in an HTML page without affecting the tags?
- Difference between application/x-javascript and text/javascript content types