how to give a link in JS

Dear Experts,
I'd like to give a link to on Google map pop up,
I want to give the link but it shows it as plain text,

the code is below,
what do you suggest I should do to get link working?

            var xml = data.responseXML;
            var markers = xml.documentElement.getElementsByTagName('marker');
  , function(markerElem) {
              var id = markerElem.getAttribute('id');
              var name = markerElem.getAttribute('name');
              var address = markerElem.getAttribute('address');
              var type = markerElem.getAttribute('type');
              var point = new google.maps.LatLng(

              var infowincontent = document.createElement('div');
              var strong = document.createElement('strong');
              strong.textContent = name

              var text = document.createElement('text');
             text.textContent = address + ' <a href="">Bayi:</a> ' + type ;
              var icon = customLabel[type] || {};
              var marker = new google.maps.Marker({
                map: map,
                position: point,
                label: icon.label
              marker.addListener('click', function() {
      , marker);
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Zakaria AcharkiAnalyst DeveloperCommented:
The textContent property sets the given value as a test if you want to set it as HTML code you need to use innerHTML instead like :

text.innerHTML = address + ' <a href="">Bayi:</a> ' + type ;

Open in new window

BRMarketingAuthor Commented:
Dear Zakaria Acharki,
this is perfect, thank you so much.

One more thing please

how can I add the paramater here 'type'?


text.innerHTML = address + ' <a href="https://www.mylink/mypage.php?id= type ">Bayi:</a> ' + type ;

thank you so much.
BRMarketingAuthor Commented:
Dear Zakaria Acharki,
I updated the my comment above, your help is needed. thank you so much
Zakaria AcharkiAnalyst DeveloperCommented:
Hi brother,

You need something like :

text.innerHTML = address + '<a href="https://www.mylink/mypage.php?id=' + type + '">Bayi:</a>';

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BRMarketingAuthor Commented:
thank you brother
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.