/    Sign up×
Community /Pin to ProfileBookmark

To change link dynamically using innerHTML

Hi,

Below is my code.
I am stuck in line shows below.

[CODE]function createRows() //to create rows using innerHTML
{
var tbody = document.getElementById(“CONTENT”); //tbody = your table body
tbody.innerHTML = “”; //empty table body
for (i=1; i<=73; i++)
{
tr = tbody.insertRow(-1); //append a row in table body
td = tr.insertCell(-1); td.innerHTML = referenceNo(i); //ref. no
td = tr.insertCell(-1); td.innerHTML = trackNo(i); //track
td= tr.insertCell(-1); td.innerHTML = ; [B]//I am stuck here[/B]
}
}[/CODE]

I would like to have function call there where it will receive a value to link it to pdf file and also display the title.

In HTML, I would be writing it like below. But, I want it to be dynamically set according to the value of i.

[code=html]<a href=”3-Management & Marketing103.pdf” target=”_blank”>XXXX</a>[/code]

How to do this? Pls help.

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @jangrina spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...