JSFiddle - React, Tailwind, and code Playground

by staeff

HTML

<!DOCTYPE html>
<html>
  <head>
    <meta name="generator" content=
    "HTML Tidy for Windows (vers 14 February 2006), see www.w3.org">
    <title>
      Exercise 1.1
    </title>
    <script src="script.js" type="text/javascript">
</script>
    <style type="text/css">
div#left {
    float:left;
    width:50%;
    }
    div#right{
    float:right;
    width:50%;
    }
    </style>
  </head>
  <body>
    <div id="left">
      <h1>
        $ methods and attributes
      </h1>
      <ul id='jQueryAttributes'></ul>
    </div>
    <div id="right">
      <h1>
        $() methods and attributes
      </h1>
      <ul id='jQueryObjectAttributes'></ul>
    </div>
  </body>
</html>

JavaScript

$('document').ready(function() {
    function addListItemTo(listId, item) {
        $('#' + listId).append($('<li/>').html(item));
    }
    var jQuery = $;
    var jQueryObject = $();

    for (var key in jQuery) {
        addListItemTo("jQueryAttributes", key);
    }

    for (var key2 in jQueryObject) {
        addListItemTo('jQueryObjectAttributes', key2);
    }
});