<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>Jquery day3 by BCS</title>
      <link>https://padlet.com/BarcelonaCodeSchool/vth03afnltgf</link>
      <description>jquery exercises</description>
      <language>en-us</language>
      <pubDate>2017-06-06 09:06:00 UTC</pubDate>
      <lastBuildDate>2017-06-06 09:08:30 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url></url>
      </image>
      <item>
         <title>Luke-exercise1</title>
         <author>BarcelonaCodeSchool</author>
         <link>https://padlet.com/BarcelonaCodeSchool/vth03afnltgf/wish/175348154</link>
         <description><![CDATA[<div>&lt;!DOCTYPE html&gt;<br>&lt;html lang="en"&gt;<br><br>&lt;head&gt;<br>&nbsp; &nbsp; &lt;meta charset="UTF-8"&gt;<br>&nbsp; &nbsp; &lt;title&gt;Document&lt;/title&gt;<br>&nbsp; &nbsp; &lt;script src="https://code.jquery.com/jquery-3.1.0.js"&gt;&lt;/script&gt;<br>&nbsp; &nbsp; &lt;link rel="stylesheet" type="text/css" href="Exercise3.css"&gt;<br>&lt;/head&gt;<br><br>&lt;body&gt;<br><br>&nbsp; &nbsp; &lt;div&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; Name:<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;input id="name" type="text" name="firstname"&gt;<br>&nbsp; &nbsp; &lt;/div&gt;<br>&nbsp; &nbsp; &lt;div&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; Course Cost:<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;input id="cost" type="number" name="coursecost"&gt;<br>&nbsp; &nbsp; &lt;/div&gt;<br>&nbsp; &nbsp; &lt;div&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; Paid:<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;input id="paid" type="number" name="paidcost"&gt;&lt;br&gt;&lt;br&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;button type="button"&gt;Submit&lt;/button&gt;<br>&nbsp; &nbsp; &lt;/div&gt;<br>&nbsp; &nbsp; &lt;table id="nameTable"&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th id="name"&gt;First Name&lt;/th&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th id="email"&gt;Surname&lt;/th&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th id="phone"&gt;Cost&lt;/th&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th id="addr"&gt;Paid&lt;/th&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;TR&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;TD class=capital&gt;Jason&lt;/TD&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;TD class=capital&gt;Bourne&lt;/TD&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/TR&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;TR&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;TD class=capital&gt;Michael&lt;/TD&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;TD class=capital&gt; Jordan&lt;/TD&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/TR&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;TR&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;TD class=capital&gt;Peter&lt;/TD&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;TD class=capital&gt;Parker&lt;/TD&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/TR&gt;<br>&nbsp; &nbsp; &lt;/table&gt;<br><br><br><br><br>&nbsp; &nbsp; &lt;script&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; $("button").click(function() {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var splitting = $('#name').val().split(' ');<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var costVal = parseFloat($('#cost').val());<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var paidVal = parseFloat($('#paid').val());<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var firstName = splitting.shift();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var secondName = splitting.join();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var initial = secondName.substring(0, 1) + ".";<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(typeof paidVal)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $("#nameTable").append("&lt;tr&gt;&lt;td&gt;" + firstName + "&lt;/td&gt;&lt;td&gt;" + secondName + "&lt;/td&gt;&lt;td&gt;" + costVal + "&lt;/td&gt;&lt;td&gt;" + paidVal + "&lt;/td&gt;&lt;/tr&gt;").addClass("capital")<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $('#nameTable').each(function() {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (paidVal &lt; costVal) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $('tr').last().css('background-color', 'red');<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (costVal &lt; paidVal) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $('tr').last().css('background-color', 'yellow');<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alert('student paid more')<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (costVal == paidVal) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $('tr').last().css('background-color', 'green');<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });<br>&nbsp; &nbsp; &nbsp; &nbsp; });<br>&nbsp; &nbsp; &lt;/script&gt;<br><br>&nbsp; &nbsp;&nbsp;<br><br>&lt;/body&gt;<br><br>&lt;/html&gt;</div>]]></description>
         <enclosure url="" />
         <pubDate>2017-06-06 09:08:26 UTC</pubDate>
         <guid>https://padlet.com/BarcelonaCodeSchool/vth03afnltgf/wish/175348154</guid>
      </item>
   </channel>
</rss>
