1

I never thought I would be making a fuss over an ampersand, but here I am. I need to use an ampersand in a text element of my HTML page,(why, you ask? long story.) but I can't type one without having my text editor thinking I'm trying to declare an entity reference. Any idea how I could do this? My code is below.

<!DOCTYPE html>
<html>
  <style>
    input {
      border-radius: 20px;
      border-color: crimson;
      border-width: 20px;
      
 width: 20%%;
 }
h1 {
  background-color: DarkCyan;  

border-radius: 20px;
font-family: sans-serif, monospace;
text-align: center;
}
p{
font-family:sans-serif, monospace;
background-color: DarkCyan;
border-radius: 20px;

text-align: center;
}
div.input{
width: 15%;
margin: auto;

}
h2{
font-family: sans-serif, monospace;


}
button {
border-radius: 20px;
background-color: crimson;
}





</style>
  <body>
    <h1>CREATE DOC</h1>
 
    <p>Email</p>
<div class = 'input'>
<input type="text" id="Email">
    </div>
 
  <p style='font-family: sans-serif, monospace;'>Doc name</p>
   <div class='input'>
   <input type="text"  id="docName">
  </div>  

 <p>Subject</p>
   <div class = 'input'>
   <input type="text" id="Sub">
 </div>

    <p>message</p>
   <div class = 'input'>
   <input type="text" id="message">
</div>
    <h2>Fill blanks for subject:</h2>

    <button id="la">LA</button>
   <br>
   <br>
    <button id="science">Science</button>
   <br>
   <br>
    <button id="I&S"> I&S</button>
   <br>
   <br>
     <button id="spanish">Spanish</button>
   <br>
   <br>
     <button id="math">math</button>
   
    <script>
    
      const buttons = document.getElementsByTagName('button');
      for (let i = 0; i < buttons.length; i++) {
        buttons[i].addEventListener('click', getValuesAndCreateDoc);
      }
   
      function getValuesAndCreateDoc(event) {
        const clicked = event.target.id;
        const email = document.getElementById('Email').value.trim();
        const docName = document.getElementById('docName').value.trim();
        const sub = document.getElementById('Sub').value.trim();
        const message = document.getElementById('message').value.trim();
        console.log('Clicked: ' + clicked);
        console.log('Email: ' + email);
        console.log('Doc Name: ' + docName);
        console.log('Sub: ' + sub);
        console.log('Message: ' + message);
        google.script.run.customDoc(clicked, email, docName, sub, message);
      }
    </script>
  </body>
</html>
LlamaButt
  • 431
  • 4
  • 15

0 Answers0