JSFiddle - React, Tailwind, and code Playground

by Jordan Marechal

HTML

<h4>Practice Set: Basic jQuery and Word Count Practice</h4>

<p>This assignment will give you practice with some basic jQuery capabilities. There are three tasks in this practice set. Use the jQuery API documentation as needed! </p>
<p>
  Your tasks are:</p>
<ol id="tasks">
  <li id="firstItem">Find the items in this list and add a yellow background to them (consider using the .css() method)</li>
  <li id="secondItem">Find the second item in this list (this one!), and write its HTML content to the third item (overwriting the third one's content)
  </li>
  <li id="thirdItem">This one gets overwritten with the content of #2 (the .html() method may be helpful here, for both reading from #2 and overwriting #3)</li>
  <li id="fourthItem">Make this item disappear if you click on it! (the .click() method may be helpful)</li>
</ol>

JavaScript

//Please use the jQuery link (https://jquery.com/) to get the same outcome of the code below.

/*$(document).ready(function(){

// code for the yellow background
    $('#tasks > li').css("background-color","yellow");
    
   
    
   $('#thirdItem').html( "<li>Find the second item in this list (this one!), and write its HTML content to the third item (overwriting the third one's content)</li>" );
   
   
$('#fourthItem').click(function(){
	$('#fourthItem').hide();	
});*/


//Also use the word count section of the jQuery link ( https://api.jquery.com/?s=word+count) to get the same outcome. Since there are several ways to get the same outcome. This should help enhace your understanding of both concepts.

/*"use strict";
console.clear();

var myTextareaElement = document.getElementById("myTextareaElement");// identifiers
var wordCount = document.getElementById("wordCount");

myTextareaElement.addEventListener ("keyup", function() {   //using keyup method

var totalwords = myTextareaElement.value.split(' ');// using the string split
wordCount.innerText = totalwords.length;

console.log(totalwords); // output written to console.
}); */

//http://jsfiddle.net/jordany2017/m1xj5Lmn/