JSFiddle - React, Tailwind, and code Playground

by Katarina Countiss

HTML

<div class="container">
      <div class="button-row">
        <input class="hello-button" type="button" value="Hello!"><br>
        <input class="test" type="button" value="Test"><br>
        <input class="arr-button" type="button" value="printarray"><br>
        <input class="hello-button" type="button" value="Answer 2"><br>
        <input class="hello-button" type="button" value="Answer 3"><br>
        <input class="hello-button" type="button" value="Answer 4"><br>
                <button id="clearall" value="Clear">Clear All</button>

                </div><!-- end button row-->
    </div><!-- end container-->

JavaScript

//this code was for solving a puzzle, but I found another way, so it's defunct.

var arr = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'];  
    var newArr = [];
(function($) {
      // Hook up handlers
      $(".hello-button").click(sayHello);
         $(".arr-button").click(printArray);
                  $(".test").click(theTest);

            $(".ans1-button").click(answerOne);
      
      // Body of the code
      function sayHello() {
        $("<p>Hello!</p>").appendTo(document.body);
      }

         function theTest() {
        $("<p> The Test</p>").prependTo(document.body);
      }
        
          
                
function getNewArr(){
    

    
   newArr.push("Kiwi", "Lemon", "Pineapple");
    
    return newArr;
             
                
         $("<p>" + newArr + "</p>").appendTo(document.body);
      }



    })(jQuery);