JSFiddle - React, Tailwind, and code Playground
by Jayden
HTML
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<button class="button">
Submit
</button>
<select class="users">
<option value="Mark">Do you wish to vote for financial sustainability </option>
<option value="Bob">Do you wish to vote for housing </option>
<option value="James">Do you wish to vote for water quality </option>
<option value="Jimmy">Do you wish to vote for recycling </option>
</select>
<div id="tabs">
<ul>
<li><a href="#tabs-1">Financial sustainability</a></li>
<li><a href="#tabs-2">Housing</a></li>
<li><a href="#tabs-3">Water quality</a></li>
<li><a href="#tabs-4">Recycling</a></li>
</ul>
<div id="tabs-1">
<p>Voting for financial sustainability will further stabilise the sustainbility of finances</p>
</div>
<div id="tabs-2">
<p>Voting for housing will change the pricing of houses</p>
</div>
<div id="tabs-3">
<p>Voting for water quality will attempt to remove dissolved solids within water sources</p>
<p>Voting for recycling with reduce environmental waste</p>
</div>
</div>
<form action="#">
<fieldset>
<label for="First name">First name:
<span class="required_input">*</span>
</label>
<input type="text" name="First name" />
</fieldset>
<fieldset>
<label for="password">Password:
<span class="required_input">*</span>
</label>
<input type="password" name="password" />
</fieldset>
<fieldset style="text-align: right; margin-bottom: 5px;">
<input type="submit" value="login" />
</fieldset>
<small id="required_notice"><span>*</span> Required</small>
</form>
<form action="#">
<fieldset>
<label for="Issue">Issue:
<span class="required_input">*</span>
</label>
<input type="text" name="Issue" />
</fieldset>
<fieldset>
...
CSS
* { margin: 2px; padding: 3px; outline: none; }
body {
background: #eee;
font: 12pt verdana;
color: #123;
}
form {
background: #fff;
width: 200px;
padding: 20px 10px;
border-radius: 6px;
border: solid 1px #aaa;
box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.15),
inset 0px -5px 10px rgba(0, 0, 0, 0.05);
margin: 50px auto;
}
fieldset {
margin-bottom: 20px;
}
form fieldset:last-child {
margin-bottom: 0px;
}
label {
font-weight: bold;
display: block;
margin-bottom: 5px;
cursor: text;
}
textarea,
input[type="text"],
input[type="password"] {
width: 189px;
display: block;
padding: 5px 5px;
border-radius: 3px;
border: solid 1px #aaa;
color: #555;
box-shadow: inset 0px 1px 4px rgba(0, 0, 0, 0.15);
}
textarea {
height: 50px;
font: 10pt arial;
}
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus {
box-shadow: inset 0px 1px 4px rgba(0, 0, 0, 0.15),
0px 0px 5px rgba(50, 153, 255, 0.5);
border: solid 1px #3299FF;
}
input[type="submit"] {
padding: 5px 15px;
border: solid 1px #265A8E;
border-radius: 3px;
color: #FFF;
font-weight: bold;
box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.75),
inset 0px -1px 3px rgba(0, 0, 0, 0.15);
cursor: pointer;
background: #7abcff; /* Old browsers */
background: -moz-linear-gradient(top, #7abcff 0%, #60abf8 44%, #4096ee 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#7abcff), color-stop(44%,#60abf8), color-stop(100%,#4096ee)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #7abcff 0%,#60abf8 44%,#4096ee 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #7abcff 0%,#60abf8 44%,#4096ee 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #7abcff 0%,#60abf8 44%,#4096ee 100%); /* IE10+ */
filter:...
JavaScript
//array of objects
my_array_of_objects = [
{id: 123456, first_name: 'Mark', last_name: 'Tomato', password: 'A1', of_age: true},
{id: 123456, first_name: 'Bob', last_name: 'Eggplant', password: 'A2', of_age: true},
{id: 123456, first_name: 'James', last_name: 'Potato', password: 'A3', of_age: true},
{id: 123456, first_name: 'Jimmy', last_name: 'Carrot', password: 'A4', of_age: true},
];
//Form values (user input from website)
var user_id = 123456;
var is_over_18 = true;
// for - loop over array and if correct id, add their age status
for(var i = 0; i < array_of_objects.length; i++){
if(user_id == array_of_objects[i].id && is_over_18 == true){
//The previous if compares both variables (using the &&)
array_of_objects[i].can_vote = true;
}
}
//for - loop through array_of_objects
//Output console.log of name
for (i = 0; i < my_array_of_objects.length; i++){
console.log(my_array_of_objects[i].first_name);
}
//while - loop through array_of_objects
//Output console.log of name
a = 0;
while (a < my_array_of_objects.length){
console.log(my_array_of_objects[a].last_name);
a++;
}
var my_bool = true;
//routine/sub-routines
$('.button').click(function() {
var message = 'You have entered your information';
var result = alert_user(message);
console.log(result);
});
function alert_user(message) {
alert(message);
return true;
}
arb_array = [];
console.log(arb_array);
arb_array.push({
id: 123456,
firstName:'Mark',
lastName: 'Tomato'
},
{
id: 123457,
firstName:'Bob',
lastName: 'Eggplant'
});
for(i = 0; i<arb_array.length; i++){
$(".users").append('<option value="'+arb_array[i].id+'">'+ arb_array[i].firstName + " " + arb_array[i].lastName + '</option>');
}
$(function() {
$( "#tabs" ).tabs();
});
//the login form
$("textarea").autoResize({
extraSpace : 0,
animateDuration : 50
});
<form method="POST">
//Array of objects
object_array = [
{id: 97123, first_name: "Penelope", password: 'Potato', post_code: '2750',...