Now, before I cananswerthisquestionthat I knowyou'reolddyingofanswerto, let's startbycreatingourindexdothtmlfile, whichiswherewe'regoingtoputalltheHTMLforapplication.
You'redifferentstylesandaredifferentJavascript, closecreativestyles, NaziSSaswellas a scriptout J s, whichisgoingtocontainallofourjavascriptandCSS.
Let's makesureweincludethesesowe'regonnaadd a linktagyou'regoingtohavein a triptoourstyleofNaziSSaswellwasgoingtosaythatitis a stylesheetlipsstylesheetjustlikethat.
Andwe'realwaysgonnadothesamethingfor a scripttag.
Makesurewedeferitsoitloadsafterthebodyandwe'regonnagiveit a sourcehere, whichisgoingtobescriptabout J s actuallyclosethatoff.
Nowwehaveourstylesheetaswellasourscripttagbeingvotedinto R H d moandlet's workonstyleinourelementsfirst.
Now, thefirstthingthatwe'regonnadoissomething I dooneverysingleproject.
Andwewanttomakethis a hueof 200 we'regonnabeusinghs l forallofourcolorssowecanuseourhueof 200 hereandwe'realsogoingtowhilewe'reatit, setupourcueforthewrongvalue.
So, Hugh, wrongitisgoingtobeourdeepredcolor, whichinourcaseisjustgoingtobezero.
Makesurethisis a cynicalinhere, andalsowecando a Hughforcorrect, whichisgoingtobethatnicegreencolor.
Wealsowanttoset a maxwithjustgoingtobe 80% inthiswayarecontentdoesn't overflowourpage.
Andifwesaythatyouseeitisshrunkendowntobeessentially 80% ofourpagewithnextthingwewanttodoiswewanttoflyhere a backgroundcolorbecausewewantthistobe a whitebackgroundandwealsowanttoapply a niceborderradiustoitsowecancomeinherewithborderradiusandthisisjustgoingtobefivepixelsnowifwesaythatyousee, wegetthatnicecardeffectalready, butourcontentswaytooclose.
Solet's add a littlebitofpaddingwillcomeinhere, whichjustsay 10 pixelsandyoucouldseethat's alreadylooking a lotbetter.
Andasyoucansee, ifwesaythatweget a verynicedarkminearoundtheentirethingduetoourspreadandthen a nice, blurredeffectcomingoutofitbecauseofourblureffectherenext, wecanworkonstyleinouranswer.
Now, whenwehover, youcanseeourborderhaschanged a blackthatlet's dothatsamehuetrickthatwedidsowecanhave a buttonwith a classofcorrectjustlikethis, andwe'realsogonnadothesamething, but a buttonwiththeclaspofwrong.
Solet's createhere a functionwhichisgoingtobecalledselectAnswernowwhat's notactuallyimplementanyoftheseyetbecausewejustneedtothinkabouttheworkflowofitfirst.
Now, hereinourstartgamefunctioniswherewewanttosetourshufflequestionsequaltothatshuffletheraysowecantakeourcurrentquestionsarraythatwehaveandallweneededtoassortitisgoingtotake a function, andifit's a negativenumber, it's goingtosortit a certainway.
Andifit's a positivenumber, it's goingtosortitanotherway.
Inordertodothat, wejustneed a loopthroughourquestionsanswerssowecanjustcomeinhereandsayquestiondotanswersstuffforeach, andwe'regonnaget a singleanswerforeachoneoftheseloopsinsidethisfunctionhere, wewanttocreate a buttonforeachoneofthem, soit's great.
A buttonusingdocumentdoctorateelementcreateelements.
Sowe'regoingtosaythatwhiletheanswerbuttonelementsdotfirstchildessentially, ifthereis a childinsideoftheanswerbuttonelements, wewanttoremoveitsowecouldjustsayanswer.