jQuery 101: Basic examples

Simple examples of selecting based on class and id of elements, binding a function to the click event, and changing css through jQuery.

HTML

<table class="table table-bordered content">
        <thead>
        <tr>
            <th>bla</th>
            <th>bla bla</th>
            <th>bla bla bla </th>
            <th>more bla</th>
        </tr>
        </thead>
        <tbody>
        <tr contenteditable="true">
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        <tr contenteditable="true">
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        </tbody>
    </table>

<button id="save">Save</button>

CSS

body {
   background-color: #eef; 
   padding: 5px;   
}

JavaScript

console.log($('.content').get(0).outerHTML);