It seems you want:
arr[1] = '<a href = "www.google.com">' + str + '</a>';
Inside of the string literal, str
doesn’t hold any meaning.
And to print you might want to use console.log
.
More Related Contents:
- Is there any way keep part of my code in a seperate document? [closed]
- Real-Time Calculation in Javascript: Based on text field and fixed price rate of an item
- Error: Can’t set headers after they are sent to the client
- Get selected text from a drop-down list (select box) using jQuery
- Refresh image with a new one at the same url
- How to have a default option in Angular.js select box
- How can I be notified when an element is added to the page?
- stopPropagation vs. stopImmediatePropagation
- Is it possible to alter a CSS stylesheet using JavaScript? (NOT the style of an object, but the stylesheet itself)
- Why am I getting weird result using parseInt in node.js? (different result from chrome js console)
- Convert JS date time to MySQL datetime
- AngularJS: How to run additional code after AngularJS has rendered a template?
- React – getting a component from a DOM element for debugging
- how do I access XHR responseBody (for binary data) from Javascript in IE?
- Is there a JavaScript strcmp()?
- Creating a JavaScript cookie on a domain and reading it across sub domains
- Cross-site AJAX requests
- Do I have to store tokens in cookies or localstorage or session?
- jQuery: Unbind event handlers to bind them again later
- Method vs Functions, and other questions
- Javascript remove all occurrence of duplicate element, leaving the only one that is unique
- Javascript unicode string, chinese character but no punctuation
- JavaScript: Remove duplicates of objects sharing same property value
- How to load all server side data on initial vue.js / vue-router load?
- Differences between detach(), hide() and remove() – jQuery
- Can I name a JavaScript function and execute it immediately?
- Storing Objects in localStorage
- angular 2 access ng-content within component
- Keeping history of hash/anchor changes in JavaScript
- How to call a function before leaving page with Javascript