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');
            Array.prototype.forEach.call(markers, 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(
                  parseFloat(markerElem.getAttribute('lat')),
                  parseFloat(markerElem.getAttribute('lng')));

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

              var text = document.createElement('text');
             text.textContent = address + ' <a href="https://www.mylink.com">Bayi:</a> ' + type ;
              infowincontent.appendChild(text);
              var icon = customLabel[type] || {};
              var marker = new google.maps.Marker({
                map: map,
                position: point,
                label: icon.label
              });
              marker.addListener('click', function() {
                infoWindow.setContent(infowincontent);
                infoWindow.open(map, marker);
              });
            });
          });
LVL 1
BRMarketingAsked:
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="https://www.mylink.com">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'?

https://www.mylink/mypage.php?id='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.