How to insert html code inside Javascript? [closed]

-1

I have this code, I wonder if it is correct the way it is?

JavaScript code:

function texto(){
    if(SONome == 'Windows 10 x32'){
    window.location.href = 
'http://teccitystore.com.br/downloads/eCHEF_Install.exe';
      var a_ = '<a class="wsite-button wsite-button-small wsite-button-
highlight"></a>';
      document.html(a);
    } else if(SONome == 'Windows 10 x64'){
      window.location.href="http://teccitystore.com.br/downloads/eCHEF_Install_x64.exe
";
      var a_ = '<a class="wsite-button wsite-button-small wsite-button-
highlight"></a>';
      document.html(a);
    }

HTML code:

<a class="wsite-button-inner"  ng-disabled="boxes.email" id="Win32" 
name="Win32" onclick="texto()">
Windows x32
</a>
    
asked by anonymous 06.09.2017 / 22:18

1 answer

1

You can use the property in the innnerHTML = or + = element and insert the html code

    
06.09.2017 / 22:22