JSFiddle - React, Tailwind, and code Playground
by akang2
HTML
<html>
<body>
<p>Hi!</p>
<input type="button" value="OMGWTFBBQ" id="here" />
<br />
<a href="#" id="unique">Unique Dude</a>
<a href="#" id="unique1">Unique wow</a>
<a href="#" id="unique2">Unique not really</a>
<a href="#" id="unique3">Unique woooord</a>
<form>
Number babe: <input type="text" id="ugh" />
<input type="submit" value="oshit!" id="shit" />
</form>
<input type="button" value="jjaeolefkmFJQEO" id="btn1" />
</body>
</html>
CSS
p {
margin-bottom: 20px;
}
a {
margin: 10px 0px;
display: block;
}
#here {
padding: 10px 0px;
margin: 20px 0px;
}
#shit {
padding: 5px;
}
JavaScript
var objects;
//function constructor that gives school object structure
function school(teachers,students,staff){
this.teachers=teachers;
this.students=students;
this.staff=staff;
this.score=getScore;
}
//adding score method
function getScore(){
var theScore=0;
theScore+=(this.teachers=="20")?50:0;
theScore+=(this.students=="25")?50:0;
theScore+=(this.staff=="8")?50:0;
return theScore;
}
//the instances for the school object
var goodSchool = new school("20","25","8");
var badSchool = new school("4","400","8");
//variables for the properties of the goodSchool instance
var numStaff = goodSchool.staff;
var numTeachers = goodSchool.teachers;
//variables for the methods of the school object
var goodSchoolScore=goodSchool.score();
var badSchoolScore=badSchool.score();
alert("The good school score is "+goodSchoolScore+" but");
alert("the bad school score is "+badSchoolScore);
with(goodSchool){
alert(teachers+" "+students+" "+staff+" are all happy");
}
var feedback=prompt("what school you wanna go to?","type it here");
if (feedback=="good"){
alert("the good school has "+goodSchool.teachers+" teachers");
}
//object initializer attempts
school={students:300,staff:1000,faculty:2000}
alert(school.students+school.staff+school.faculty+ ' people at this place');