How to use onClick method in storybook-root

Best JavaScript code snippet using storybook-root

modal.js

Source:modal.js Github

copy

Full Screen

1/*------------------------------Modal 1969------------------------*/2var modal1969amd = document.getElementById("modal_1969_amd");3var btn1969amd = document.getElementById("btn_modal_amd_1969");4var span1969amd = document.getElementsByClassName("closeamd1969")[0];5btn1969amd.onclick = function() {6 modal1969amd.style.display = "block";7}8span1969amd.onclick = function() {9 modal1969amd.style.display = "none";10}11/*window.onclick = function(event) {12 if (event.target == modal1969amd) {13 modal1969amd.style.display = "none";14 }15}*/16171819//var test = document.getElementById('')2021/*------------------------------Modal 1970 pdp------------------------*/22var modal1970pdp = document.getElementById("modal_1970_pdp");23var btn1970pdp = document.getElementById("btn_modal_pdp_1970");24var span1970pdp = document.getElementsByClassName("closepdp1970")[0];25btn1970pdp.onclick = function() {26 modal1970pdp.style.display = "block";27}28span1970pdp.onclick = function() {29 modal1970pdp.style.display = "none";30}31/*window.onclick = function(event) {32 if (event.target == modal1970pdp) {33 modal1970pdp.style.display = "none";34 }35}*/3637/*------------------------------Modal 1970 souris------------------------*/38var modal1970souris = document.getElementById("modal_1970_souris");39var btn1970souris = document.getElementById("btn_modal_souris_1970");40var span1970souris = document.getElementsByClassName("closesouris1970")[0];41btn1970souris.onclick = function() {42 modal1970souris.style.display = "block";43}44span1970souris.onclick = function() {45 modal1970souris.style.display = "none";46}47window.onclick = function(event) {48 if (event.target == modal1970souris) {49 modal1970souris.style.display = "none";50 }51}5253/*------------------------------Modal 1971------------------------*/54var modal19714004 = document.getElementById("modal_1971_4004");55var btn19714004 = document.getElementById("btn_modal_4004_1971");56var span19714004 = document.getElementsByClassName("close40041971")[0];57btn19714004.onclick = function() {58 modal19714004.style.display = "block";59}60span19714004.onclick = function() {61 modal19714004.style.display = "none";62}63window.onclick = function(event) {64 if (event.target == modal19714004) {65 modal19714004.style.display = "none";66 }67}6869/*------------------------------Modal 1972------------------------*/70var modal1972mess = document.getElementById("modal_1972_mess");71var btn1972mess = document.getElementById("btn_modal_mess_1972");72var span1972mess = document.getElementsByClassName("closemess1972")[0];73btn1972mess.onclick = function() {74 modal1972mess.style.display = "block";75}76span1972mess.onclick = function() {77 modal1972mess.style.display = "none";78}79window.onclick = function(event) {80 if (event.target == modal1972mess) {81 modal1972mess.style.display = "none";82 }83}8485/*------------------------------Modal 1973------------------------*/86var modal1973micro = document.getElementById("modal_1973_micro");87var btn1973micro = document.getElementById("btn_modal_micro_1973");88var span1973micro = document.getElementsByClassName("closemicro1973")[0];89btn1973micro.onclick = function() {90 modal1973micro.style.display = "block";91}92span1973micro.onclick = function() {93 modal1973micro.style.display = "none";94}95window.onclick = function(event) {96 if (event.target == modal1973micro) {97 modal1973micro.style.display = "none";98 }99}100101/*------------------------------Modal 1974 cnil------------------------*/102var modal1974cnil = document.getElementById("modal_1974_cnil");103var btn1974cnil = document.getElementById("btn_modal_cnil_1974");104var span1974cnil = document.getElementsByClassName("closecnil1974")[0];105btn1974cnil.onclick = function() {106 modal1974cnil.style.display = "block";107}108span1974cnil.onclick = function() {109 modal1974cnil.style.display = "none";110}111window.onclick = function(event) {112 if (event.target == modal1974cnil) {113 modal1974cnil.style.display = "none";114 }115}116/*------------------------------Modal 1974 8008------------------------*/117var modal19748008 = document.getElementById("modal_1974_8008");118var btn19748008 = document.getElementById("btn_modal_8008_1974");119var span19748008 = document.getElementsByClassName("close80081974")[0];120btn19748008.onclick = function() {121 modal19748008.style.display = "block";122}123span19748008.onclick = function() {124 modal19748008.style.display = "none";125}126window.onclick = function(event) {127 if (event.target == modal19748008) {128 modal19748008.style.display = "none";129 }130}131/*------------------------------Modal 1975 risc------------------------*/132var modal1975risc = document.getElementById("modal_1975_risc");133var btn1975risc = document.getElementById("btn_modal_risc_1975");134var span1975risc = document.getElementsByClassName("closerisc1975")[0];135btn1975risc.onclick = function() {136 modal1975risc.style.display = "block";137}138span1975risc.onclick = function() {139 modal1975risc.style.display = "none";140}141window.onclick = function(event) {142 if (event.target == modal1975risc) {143 modal1975risc.style.display = "none";144 }145}146/*------------------------------Modal 1975 mcsft------------------------*/147var modal1975mcsft = document.getElementById("modal_1975_mcsft");148var btn1975mcsft = document.getElementById("btn_modal_mcsft_1975");149var span1975mcsft = document.getElementsByClassName("closemcsft1975")[0];150btn1975mcsft.onclick = function() {151 modal1975mcsft.style.display = "block";152}153span1975mcsft.onclick = function() {154 modal1975mcsft.style.display = "none";155}156window.onclick = function(event) {157 if (event.target == modal1975mcsft) {158 modal1975mcsft.style.display = "none";159 }160}161162/*------------------------------Modal 1975 mos------------------------*/163var modal1975mos = document.getElementById("modal_1975_mos");164var btn1975mos = document.getElementById("btn_modal_mos_1975");165var span1975mos = document.getElementsByClassName("closemos1975")[0];166btn1975mos.onclick = function() {167 modal1975mos.style.display = "block";168}169span1975mos.onclick = function() {170 modal1975mos.style.display = "none";171}172window.onclick = function(event) {173 if (event.target == modal1975mos) {174 modal1975mos.style.display = "none";175 }176}177178/*------------------------------Modal 1976 apple------------------------*/179var modal1976apple = document.getElementById("modal_1976_apple");180var btn1976apple = document.getElementById("btn_modal_apple_1976");181var span1976apple = document.getElementsByClassName("closeapple1976")[0];182btn1976apple.onclick = function() {183 modal1976apple.style.display = "block";184}185span1976apple.onclick = function() {186 modal1976apple.style.display = "none";187}188window.onclick = function(event) {189 if (event.target == modal1976apple) {190 modal1976apple.style.display = "none";191 }192}193194/*------------------------------Modal 1977 apple------------------------*/195var modal1977apple = document.getElementById("modal_1977_apple");196var btn1977apple = document.getElementById("btn_modal_apple_1977");197var span1977apple = document.getElementsByClassName("closeapple1977")[0];198btn1977apple.onclick = function() {199 modal1977apple.style.display = "block";200}201span1977apple.onclick = function() {202 modal1977apple.style.display = "none";203}204window.onclick = function(event) {205 if (event.target == modal1977apple) {206 modal1977apple.style.display = "none";207 }208}209210/*------------------------------Modal 1978 apple------------------------*/211var modal1978apple = document.getElementById("modal_1978_apple");212var btn1978apple = document.getElementById("btn_modal_apple_1978");213var span1978apple = document.getElementsByClassName("closeapple1978")[0];214btn1978apple.onclick = function() {215 modal1978apple.style.display = "block";216}217span1978apple.onclick = function() {218 modal1978apple.style.display = "none";219}220window.onclick = function(event) {221 if (event.target == modal1978apple) {222 modal1978apple.style.display = "none";223 }224}225226/*------------------------------Modal 1978 revue------------------------*/227var modal1978revue = document.getElementById("modal_1978_revue");228var btn1978revue = document.getElementById("btn_modal_revue_1978");229var span1978revue = document.getElementsByClassName("closerevue1978")[0];230btn1978revue.onclick = function() {231 modal1978revue.style.display = "block";232}233span1978revue.onclick = function() {234 modal1978revue.style.display = "none";235}236window.onclick = function(event) {237 if (event.target == modal1978revue) {238 modal1978revue.style.display = "none";239 }240}241242/*------------------------------Modal 1979 visi------------------------*/243var modal1979visi = document.getElementById("modal_1979_visi");244var btn1979visi = document.getElementById("btn_modal_visi_1979");245var span1979visi = document.getElementsByClassName("closevisi1979")[0];246btn1979visi.onclick = function() {247 modal1979visi.style.display = "block";248}249span1979visi.onclick = function() {250 modal1979visi.style.display = "none";251}252window.onclick = function(event) {253 if (event.target == modal1979visi) {254 modal1979visi.style.display = "none";255 }256}257258/*------------------------------Modal 1979 trs------------------------*/259var modal1979trs = document.getElementById("modal_1979_trs");260var btn1979trs = document.getElementById("btn_modal_trs_1979");261var span1979trs = document.getElementsByClassName("closetrs1979")[0];262btn1979trs.onclick = function() {263 modal1979trs.style.display = "block";264}265span1979trs.onclick = function() {266 modal1979trs.style.display = "none";267}268window.onclick = function(event) {269 if (event.target == modal1979trs) {270 modal1979trs.style.display = "none";271 }272}273274/*------------------------------Modal 1979 compuserve------------------------*/275var modal1979compuserve = document.getElementById("modal_1979_compuserve");276var btn1979compuserve = document.getElementById("btn_modal_compuserve_1979");277var span1979compuserve = document.getElementsByClassName("closecompuserve1979")[0];278btn1979compuserve.onclick = function() {279 modal1979compuserve.style.display = "block";280}281span1979compuserve.onclick = function() {282 modal1979compuserve.style.display = "none";283}284window.onclick = function(event) {285 if (event.target == modal1979compuserve) {286 modal1979compuserve.style.display = "none";287 }288}289290/*------------------------------Modal 1980 fril------------------------*/291var modal1980fril = document.getElementById("modal_1980_fril");292var btn1980fril = document.getElementById("btn_modal_fril_1980");293var span1980fril = document.getElementsByClassName("closefril1980")[0];294btn1980fril.onclick = function() {295 modal1980fril.style.display = "block";296}297span1980fril.onclick = function() {298 modal1980fril.style.display = "none";299}300window.onclick = function(event) {301 if (event.target == modal1980fril) {302 modal1980fril.style.display = "none";303 }304}305306/*------------------------------Modal 1980 cd------------------------*/307var modal1980cd = document.getElementById("modal_1980_cd");308var btn1980cd = document.getElementById("btn_modal_cd_1980");309var span1980cd = document.getElementsByClassName("closecd1980")[0];310btn1980cd.onclick = function() {311 modal1980cd.style.display = "block";312}313span1980cd.onclick = function() {314 modal1980cd.style.display = "none";315}316window.onclick = function(event) {317 if (event.target == modal1980cd) {318 modal1980cd.style.display = "none";319 }320}321322/*------------------------------Modal 1981 disquette------------------------*/323var modal1981disquette = document.getElementById("modal_1981_disquette");324var btn1981disquette = document.getElementById("btn_modal_disquette_1981");325var span1981disquette = document.getElementsByClassName("closedisquette1981")[0];326btn1981disquette.onclick = function() {327 modal1981disquette.style.display = "block";328}329span1981disquette.onclick = function() {330 modal1981disquette.style.display = "none";331}332window.onclick = function(event) {333 if (event.target == modal1981disquette) {334 modal1981disquette.style.display = "none";335 }336}337338/*------------------------------Modal 1982 commodore------------------------*/339var modal1982commodore = document.getElementById("modal_1982_commodore");340var btn1982commodore = document.getElementById("btn_modal_commodore_1982");341var span1982commodore = document.getElementsByClassName("closecommodore1982")[0];342btn1982commodore.onclick = function() {343 modal1982commodore.style.display = "block";344}345span1982commodore.onclick = function() {346 modal1982commodore.style.display = "none";347}348window.onclick = function(event) {349 if (event.target == modal1982commodore) {350 modal1982commodore.style.display = "none";351 }352}353354/*------------------------------Modal 1982 dos------------------------*/355var modal1982dos = document.getElementById("modal_1982_dos");356var btn1982dos = document.getElementById("btn_modal_dos_1982");357var span1982dos = document.getElementsByClassName("closedos1982")[0];358btn1982dos.onclick = function() {359 modal1982dos.style.display = "block";360}361span1982dos.onclick = function() {362 modal1982dos.style.display = "none";363}364window.onclick = function(event) {365 if (event.target == modal1982dos) {366 modal1982dos.style.display = "none";367 }368}369370/*------------------------------Modal 1983 cpp------------------------*/371var modal1983cpp = document.getElementById("modal_1983_cpp");372var btn1983cpp = document.getElementById("btn_modal_cpp_1983");373var span1983cpp = document.getElementsByClassName("closecpp1983")[0];374btn1983cpp.onclick = function() {375 modal1983cpp.style.display = "block";376}377span1983cpp.onclick = function() {378 modal1983cpp.style.display = "none";379}380window.onclick = function(event) {381 if (event.target == modal1983cpp) {382 modal1983cpp.style.display = "none";383 }384}385386/*------------------------------Modal 1984 mac------------------------*/387var modal1984mac = document.getElementById("modal_1984_mac");388var btn1984mac = document.getElementById("btn_modal_mac_1984");389var span1984mac = document.getElementsByClassName("closemac1984")[0];390btn1984mac.onclick = function() {391 modal1984mac.style.display = "block";392}393span1984mac.onclick = function() {394 modal1984mac.style.display = "none";395}396window.onclick = function(event) {397 if (event.target == modal1984mac) {398 modal1984mac.style.display = "none";399 }400}401402/*------------------------------Modal 1985 nomdom------------------------*/403var modal1985nomdom = document.getElementById("modal_1985_nomdom");404var btn1985nomdom = document.getElementById("btn_modal_nomdom_1985");405var span1985nomdom = document.getElementsByClassName("closenomdom1985")[0];406btn1985nomdom.onclick = function() {407 modal1985nomdom.style.display = "block";408}409span1985nomdom.onclick = function() {410 modal1985nomdom.style.display = "none";411}412window.onclick = function(event) {413 if (event.target == modal1985nomdom) {414 modal1985nomdom.style.display = "none";415 }416}417/*------------------------------Modal 1985 windows1------------------------*/418var modal1985windows1 = document.getElementById("modal_1985_windows1");419var btn1985windows1 = document.getElementById("btn_modal_windows1_1985");420var span1985windows1 = document.getElementsByClassName("closewindows11985")[0];421btn1985windows1.onclick = function() {422 modal1985windows1.style.display = "block";423}424span1985windows1.onclick = function() {425 modal1985windows1.style.display = "none";426}427window.onclick = function(event) {428 if (event.target == modal1985windows1) {429 modal1985windows1.style.display = "none";430 }431}432433/*------------------------------Modal 1986 risc------------------------*/434var modal1986risc = document.getElementById("modal_1986_risc");435var btn1986risc = document.getElementById("btn_modal_risc_1986");436var span1986risc = document.getElementsByClassName("closerisc1986")[0];437btn1986risc.onclick = function() {438 modal1986risc.style.display = "block";439}440span1986risc.onclick = function() {441 modal1986risc.style.display = "none";442}443window.onclick = function(event) {444 if (event.target == modal1986risc) {445 modal1986risc.style.display = "none";446 }447}448/*------------------------------Modal 1987 windows2------------------------*/449var modal1987windows2 = document.getElementById("modal_1987_windows2");450var btn1987windows2 = document.getElementById("btn_modal_windows2_1987");451var span1987windows2 = document.getElementsByClassName("closewindows21987")[0];452btn1987windows2.onclick = function() {453 modal1987windows2.style.display = "block";454}455span1987windows2.onclick = function() {456 modal1987windows2.style.display = "none";457}458window.onclick = function(event) {459 if (event.target == modal1987windows2) {460 modal1987windows2.style.display = "none";461 }462}463464/*------------------------------Modal 1988 as400------------------------*/465var modal1988as400 = document.getElementById("modal_1988_as400");466var btn1988as400 = document.getElementById("btn_modal_as400_1988");467var span1988as400 = document.getElementsByClassName("closeas4001988")[0];468btn1988as400.onclick = function() {469 modal1988as400.style.display = "block";470}471span1988as400.onclick = function() {472 modal1988as400.style.display = "none";473}474window.onclick = function(event) {475 if (event.target == modal1988as400) {476 modal1988as400.style.display = "none";477 }478}479480/*------------------------------Modal 1989 nextstep------------------------*/481var modal1989nextstep = document.getElementById("modal_1989_nextstep");482var btn1989nextstep = document.getElementById("btn_modal_nextstep_1989");483var span1989nextstep = document.getElementsByClassName("closenextstep1989")[0];484btn1989nextstep.onclick = function() {485 modal1989nextstep.style.display = "block";486}487span1989nextstep.onclick = function() {488 modal1989nextstep.style.display = "none";489}490window.onclick = function(event) {491 if (event.target == modal1989nextstep) {492 modal1989nextstep.style.display = "none";493 }494}495496/*------------------------------Modal 1989 www------------------------*/497var modal1989www = document.getElementById("modal_1989_www");498var btn1989www = document.getElementById("btn_modal_www_1989");499var span1989www = document.getElementsByClassName("closewww1989")[0];500btn1989www.onclick = function() {501 modal1989www.style.display = "block";502}503span1989www.onclick = function() {504 modal1989www.style.display = "none";505}506window.onclick = function(event) {507 if (event.target == modal1989www) {508 modal1989www.style.display = "none";509 }510}511512/*------------------------------Modal 1990 beos------------------------*/513var modal1990beos = document.getElementById("modal_1990_beos");514var btn1990beos = document.getElementById("btn_modal_beos_1990");515var span1990beos = document.getElementsByClassName("closebeos1990")[0];516btn1990beos.onclick = function() {517 modal1990beos.style.display = "block";518}519span1990beos.onclick = function() {520 modal1990beos.style.display = "none";521}522window.onclick = function(event) {523 if (event.target == modal1990beos) {524 modal1990beos.style.display = "none";525 }526}527528/*------------------------------Modal 1990 tcp------------------------*/529var modal1990tcp = document.getElementById("modal_1990_tcp");530var btn1990tcp = document.getElementById("btn_modal_tcp_1990");531var span1990tcp = document.getElementsByClassName("closetcp1990")[0];532btn1990tcp.onclick = function() {533 modal1990tcp.style.display = "block";534}535span1990tcp.onclick = function() {536 modal1990tcp.style.display = "none";537}538window.onclick = function(event) {539 if (event.target == modal1990tcp) {540 modal1990tcp.style.display = "none";541 }542}543544/*------------------------------Modal 1991 linux001------------------------*/545var modal1991linux001 = document.getElementById("modal_1991_linux001");546var btn1991linux001 = document.getElementById("btn_modal_linux001_1991");547var span1991linux001 = document.getElementsByClassName("closelinux0011991")[0];548btn1991linux001.onclick = function() {549 modal1991linux001.style.display = "block";550}551span1991linux001.onclick = function() {552 modal1991linux001.style.display = "none";553}554window.onclick = function(event) {555 if (event.target == modal1991linux001) {556 modal1991linux001.style.display = "none";557 }558}559560/*------------------------------Modal 1991 apples7------------------------*/561var modal1991apples7 = document.getElementById("modal_1991_apples7");562var btn1991apples7 = document.getElementById("btn_modal_apples7_1991");563var span1991apples7 = document.getElementsByClassName("closeapples71991")[0];564btn1991apples7.onclick = function() {565 modal1991apples7.style.display = "block";566}567span1991apples7.onclick = function() {568 modal1991apples7.style.display = "none";569}570window.onclick = function(event) {571 if (event.target == modal1991apples7) {572 modal1991apples7.style.display = "none";573 }574}575576/*------------------------------Modal 1992 windows3------------------------*/577var modal1992windows3 = document.getElementById("modal_1992_windows3");578var btn1992windows3 = document.getElementById("btn_modal_windows3_1992");579var span1992windows3 = document.getElementsByClassName("closewindows31992")[0];580btn1992windows3.onclick = function() {581 modal1992windows3.style.display = "block";582}583span1992windows3.onclick = function() {584 modal1992windows3.style.display = "none";585}586window.onclick = function(event) {587 if (event.target == modal1992windows3) {588 modal1992windows3.style.display = "none";589 }590}591592/*------------------------------Modal 1993 pentium------------------------*/593var modal1993pentium = document.getElementById("modal_1993_pentium");594var btn1993pentium = document.getElementById("btn_modal_pentium_1993");595var span1993pentium = document.getElementsByClassName("closepentium1993")[0];596btn1993pentium.onclick = function() {597 modal1993pentium.style.display = "block";598}599span1993pentium.onclick = function() {600 modal1993pentium.style.display = "none";601}602window.onclick = function(event) {603 if (event.target == modal1993pentium) {604 modal1993pentium.style.display = "none";605 }606}607608/*------------------------------Modal 1993 windowsnt------------------------*/609var modal1993windowsnt = document.getElementById("modal_1993_windowsnt");610var btn1993windowsnt = document.getElementById("btn_modal_windowsnt_1993");611var span1993windowsnt = document.getElementsByClassName("closewindowsnt1993")[0];612btn1993windowsnt.onclick = function() {613 modal1993windowsnt.style.display = "block";614}615span1993windowsnt.onclick = function() {616 modal1993windowsnt.style.display = "none";617}618window.onclick = function(event) {619 if (event.target == modal1993windowsnt) {620 modal1993windowsnt.style.display = "none";621 }622}623624/*------------------------------Modal 1993 mosaic------------------------*/625var modal1993mosaic = document.getElementById("modal_1993_mosaic");626var btn1993mosaic = document.getElementById("btn_modal_mosaic_1993");627var span1993mosaic = document.getElementsByClassName("closemosaic1993")[0];628btn1993mosaic.onclick = function() {629 modal1993mosaic.style.display = "block";630}631span1993mosaic.onclick = function() {632 modal1993mosaic.style.display = "none";633}634window.onclick = function(event) {635 if (event.target == modal1993mosaic) {636 modal1993mosaic.style.display = "none";637 }638}639640/*------------------------------Modal 1994 sex------------------------*/641var modal1994sex = document.getElementById("modal_1994_sex");642var btn1994sex = document.getElementById("btn_modal_sex_1994");643var span1994sex = document.getElementsByClassName("closesex1994")[0];644btn1994sex.onclick = function() {645 modal1994sex.style.display = "block";646}647span1994sex.onclick = function() {648 modal1994sex.style.display = "none";649}650window.onclick = function(event) {651 if (event.target == modal1994sex) {652 modal1994sex.style.display = "none";653 }654}655656/*------------------------------Modal 1994 powermac------------------------*/657var modal1994powermac = document.getElementById("modal_1994_powermac");658var btn1994powermac = document.getElementById("btn_modal_powermac_1994");659var span1994powermac = document.getElementsByClassName("closepowermac1994")[0];660btn1994powermac.onclick = function() {661 modal1994powermac.style.display = "block";662}663span1994powermac.onclick = function() {664 modal1994powermac.style.display = "none";665}666window.onclick = function(event) {667 if (event.target == modal1994powermac) {668 modal1994powermac.style.display = "none";669 }670}671672/*------------------------------Modal 1994 netscape------------------------*/673var modal1994netscape = document.getElementById("modal_1994_netscape");674var btn1994netscape = document.getElementById("btn_modal_netscape_1994");675var span1994netscape = document.getElementsByClassName("closenetscape1994")[0];676btn1994netscape.onclick = function() {677 modal1994netscape.style.display = "block";678}679span1994netscape.onclick = function() {680 modal1994netscape.style.display = "none";681}682window.onclick = function(event) {683 if (event.target == modal1994netscape) {684 modal1994netscape.style.display = "none";685 }686}687/*------------------------------Modal 1995 amazon------------------------*/688var modal1995amazon = document.getElementById("modal_1995_amazon");689var btn1995amazon = document.getElementById("btn_modal_amazon_1995");690var span1995amazon = document.getElementsByClassName("closeamazon1995")[0];691btn1995amazon.onclick = function() {692 modal1995amazon.style.display = "block";693}694span1995amazon.onclick = function() {695 modal1995amazon.style.display = "none";696}697window.onclick = function(event) {698 if (event.target == modal1995amazon) {699 modal1995amazon.style.display = "none";700 }701}702703/*------------------------------Modal 1995 iexplorer------------------------*/704var modal1995iexplorer = document.getElementById("modal_1995_iexplorer");705var btn1995iexplorer = document.getElementById("btn_modal_iexplorer_1995");706var span1995iexplorer = document.getElementsByClassName("closeiexplorer1995")[0];707btn1995iexplorer.onclick = function() {708 modal1995iexplorer.style.display = "block";709}710span1995iexplorer.onclick = function() {711 modal1995iexplorer.style.display = "none";712}713window.onclick = function(event) {714 if (event.target == modal1995iexplorer) {715 modal1995iexplorer.style.display = "none";716 }717}718719/*------------------------------Modal 1996 microsoft------------------------*/720var modal1996microsoft = document.getElementById("modal_1996_microsoft");721var btn1996microsoft = document.getElementById("btn_modal_microsoft_1996");722var span1996microsoft = document.getElementsByClassName("closemicrosoft1996")[0];723btn1996microsoft.onclick = function() {724 modal1996microsoft.style.display = "block";725}726span1996microsoft.onclick = function() {727 modal1996microsoft.style.display = "none";728}729window.onclick = function(event) {730 if (event.target == modal1996microsoft) {731 modal1996microsoft.style.display = "none";732 }733}734/*------------------------------Modal 1996 linux------------------------*/735var modal1996linux = document.getElementById("modal_1996_linux");736var btn1996linux = document.getElementById("btn_modal_linux_1996");737var span1996linux = document.getElementsByClassName("closelinux1996")[0];738btn1996linux.onclick = function() {739 modal1996linux.style.display = "block";740}741span1996linux.onclick = function() {742 modal1996linux.style.display = "none";743}744window.onclick = function(event) {745 if (event.target == modal1996linux) {746 modal1996linux.style.display = "none";747 }748}749/*------------------------------Modal 1997 macos8------------------------*/750var modal1997macos8 = document.getElementById("modal_1997_macos8");751var btn1997macos8 = document.getElementById("btn_modal_macos8_1997");752var span1997macos8 = document.getElementsByClassName("closemacos81997")[0];753btn1997macos8.onclick = function() {754 modal1997macos8.style.display = "block";755}756span1997macos8.onclick = function() {757 modal1997macos8.style.display = "none";758}759window.onclick = function(event) {760 if (event.target == modal1997macos8) {761 modal1997macos8.style.display = "none";762 }763}764765/*------------------------------Modal 1998 google------------------------*/766var modal1998google = document.getElementById("modal_1998_google");767var btn1998google = document.getElementById("btn_modal_google_1998");768var span1998google = document.getElementsByClassName("closegoogle1998")[0];769btn1998google.onclick = function() {770 modal1998google.style.display = "block";771}772span1998google.onclick = function() {773 modal1998google.style.display = "none";774}775window.onclick = function(event) {776 if (event.target == modal1998google) {777 modal1998google.style.display = "none";778 }779}780/*------------------------------Modal 1998 apple------------------------*/781var modal1998apple = document.getElementById("modal_1998_apple");782var btn1998apple = document.getElementById("btn_modal_apple_1998");783var span1998apple = document.getElementsByClassName("closeapple1998")[0];784btn1998apple.onclick = function() {785 modal1998apple.style.display = "block";786}787span1998apple.onclick = function() {788 modal1998apple.style.display = "none";789}790window.onclick = function(event) {791 if (event.target == modal1998apple) {792 modal1998apple.style.display = "none";793 }794}795/*------------------------------Modal 1998 windows98------------------------*/796var modal1998windows98 = document.getElementById("modal_1998_windows98");797var btn1998windows98 = document.getElementById("btn_modal_windows98_1998");798var span1998windows98 = document.getElementsByClassName("closewindows981998")[0];799btn1998windows98.onclick = function() {800 modal1998windows98.style.display = "block";801}802span1998windows98.onclick = function() {803 modal1998windows98.style.display = "none";804}805window.onclick = function(event) {806 if (event.target == modal1998windows98) {807 modal1998windows98.style.display = "none";808 }809}810811/*------------------------------Modal 1999 linux22------------------------*/812var modal1999linux22 = document.getElementById("modal_1999_linux22");813var btn1999linux22 = document.getElementById("btn_modal_linux22_1999");814var span1999linux22 = document.getElementsByClassName("closelinux221999")[0];815btn1999linux22.onclick = function() {816 modal1999linux22.style.display = "block";817}818span1999linux22.onclick = function() {819 modal1999linux22.style.display = "none";820}821window.onclick = function(event) {822 if (event.target == modal1999linux22) {823 modal1999linux22.style.display = "none";824 }825}826/*------------------------------Modal 1999 macos9------------------------*/827var modal1999macos9 = document.getElementById("modal_1999_macos9");828var btn1999macos9 = document.getElementById("btn_modal_macos9_1999");829var span1999macos9 = document.getElementsByClassName("closemacos91999")[0];830btn1999macos9.onclick = function() {831 modal1999macos9.style.display = "block";832}833span1999macos9.onclick = function() {834 modal1999macos9.style.display = "none";835}836window.onclick = function(event) {837 if (event.target == modal1999macos9) {838 modal1999macos9.style.display = "none";839 }840}841842/*------------------------------Modal 2000 microsoft------------------------*/843var modal2000microsoft = document.getElementById("modal_2000_microsoft");844var btn2000microsoft = document.getElementById("btn_modal_microsoft_2000");845var span2000microsoft = document.getElementsByClassName("closemicrosoft2000")[0];846btn2000microsoft.onclick = function() {847 modal2000microsoft.style.display = "block";848}849span2000microsoft.onclick = function() {850 modal2000microsoft.style.display = "none";851}852window.onclick = function(event) {853 if (event.target == modal2000microsoft) {854 modal2000microsoft.style.display = "none";855 }856}857858/*------------------------------Modal 2001 wiki------------------------*/859var modal2001wiki = document.getElementById("modal_2001_wiki");860var btn2001wiki = document.getElementById("btn_modal_wiki_2001");861var span2001wiki = document.getElementsByClassName("closewiki2001")[0];862btn2001wiki.onclick = function() {863 modal2001wiki.style.display = "block";864}865span2001wiki.onclick = function() {866 modal2001wiki.style.display = "none";867}868window.onclick = function(event) {869 if (event.target == modal2001wiki) {870 modal2001wiki.style.display = "none";871 }872}873874/*------------------------------Modal 2002 tor------------------------*/875var modal2002tor = document.getElementById("modal_2002_tor");876var btn2002tor = document.getElementById("btn_modal_tor_2002");877var span2002tor = document.getElementsByClassName("closetor2002")[0];878btn2002tor.onclick = function() {879 modal2002tor.style.display = "block";880}881span2002tor.onclick = function() {882 modal2002tor.style.display = "none";883}884window.onclick = function(event) {885 if (event.target == modal2002tor) {886 modal2002tor.style.display = "none";887 }888}889890/*------------------------------Modal 2003 powermac------------------------*/891var modal2003powermac = document.getElementById("modal_2003_powermac");892var btn2003powermac = document.getElementById("btn_modal_powermac_2003");893var span2003powermac = document.getElementsByClassName("closepowermac2003")[0];894btn2003powermac.onclick = function() {895 modal2003powermac.style.display = "block";896}897span2003powermac.onclick = function() {898 modal2003powermac.style.display = "none";899}900window.onclick = function(event) {901 if (event.target == modal2003powermac) {902 modal2003powermac.style.display = "none";903 }904}905906/*------------------------------Modal 2003 linux------------------------*/907var modal2003linux = document.getElementById("modal_2003_linux");908var btn2003linux = document.getElementById("btn_modal_linux_2003");909var span2003linux = document.getElementsByClassName("closelinux2003")[0];910btn2003linux.onclick = function() {911 modal2003linux.style.display = "block";912}913span2003linux.onclick = function() {914 modal2003linux.style.display = "none";915}916window.onclick = function(event) {917 if (event.target == modal2003linux) {918 modal2003linux.style.display = "none";919 }920}921922/*------------------------------Modal 2004 fb------------------------*/923var modal2004fb = document.getElementById("modal_2004_fb");924var btn2004fb = document.getElementById("btn_modal_fb_2004");925var span2004fb = document.getElementsByClassName("closefb2004")[0];926btn2004fb.onclick = function() {927 modal2004fb.style.display = "block";928}929span2004fb.onclick = function() {930 modal2004fb.style.display = "none";931}932window.onclick = function(event) {933 if (event.target == modal2004fb) {934 modal2004fb.style.display = "none";935 }936}937938/*------------------------------Modal 2004 linux26------------------------*/939var modal2004linux26 = document.getElementById("modal_2004_linux26");940var btn2004linux26 = document.getElementById("btn_modal_linux26_2004");941var span2004linux26 = document.getElementsByClassName("closelinux262004")[0];942btn2004linux26.onclick = function() {943 modal2004linux26.style.display = "block";944}945span2004linux26.onclick = function() {946 modal2004linux26.style.display = "none";947}948window.onclick = function(event) {949 if (event.target == modal2004linux26) {950 modal2004linux26.style.display = "none";951 }952}953954/*------------------------------Modal 2005 yt------------------------*/955var modal2005yt = document.getElementById("modal_2005_yt");956var btn2005yt = document.getElementById("btn_modal_yt_2005");957var span2005yt = document.getElementsByClassName("closeyt2005")[0];958btn2005yt.onclick = function() {959 modal2005yt.style.display = "block";960}961span2005yt.onclick = function() {962 modal2005yt.style.display = "none";963}964window.onclick = function(event) {965 if (event.target == modal2005yt) {966 modal2005yt.style.display = "none";967 }968}969/*------------------------------Modal 2006 iexplorer7------------------------*/970var modal2006iexplorer7 = document.getElementById("modal_2006_iexplorer7");971var btn2006iexplorer7 = document.getElementById("btn_modal_iexplorer7_2006");972var span2006iexplorer7 = document.getElementsByClassName("closeiexplorer72006")[0];973btn2006iexplorer7.onclick = function() {974 modal2006iexplorer7.style.display = "block";975}976span2006iexplorer7.onclick = function() {977 modal2006iexplorer7.style.display = "none";978}979window.onclick = function(event) {980 if (event.target == modal2006iexplorer7) {981 modal2006iexplorer7.style.display = "none";982 }983}984/*------------------------------Modal 2006 firefox------------------------*/985var modal2006firefox = document.getElementById("modal_2006_firefox");986var btn2006firefox = document.getElementById("btn_modal_firefox_2006");987var span2006firefox = document.getElementsByClassName("closefirefox2006")[0];988btn2006firefox.onclick = function() {989 modal2006firefox.style.display = "block";990}991span2006firefox.onclick = function() {992 modal2006firefox.style.display = "none";993}994window.onclick = function(event) {995 if (event.target == modal2006firefox) {996 modal2006firefox.style.display = "none";997 }998}999/*------------------------------Modal 2006 opendocument------------------------*/1000var modal2006opendocument = document.getElementById("modal_2006_opendocument");1001var btn2006opendocument = document.getElementById("btn_modal_opendocument_2006");1002var span2006opendocument = document.getElementsByClassName("closeopendocument2006")[0];1003btn2006opendocument.onclick = function() {1004 modal2006opendocument.style.display = "block";1005}1006span2006opendocument.onclick = function() {1007 modal2006opendocument.style.display = "none";1008}1009window.onclick = function(event) {1010 if (event.target == modal2006opendocument) {1011 modal2006opendocument.style.display = "none";1012 }1013}10141015/*------------------------------Modal 2007 vista------------------------*/1016var modal2007vista = document.getElementById("modal_2007_vista");1017var btn2007vista = document.getElementById("btn_modal_vista_2007");1018var span2007vista = document.getElementsByClassName("closevista2007")[0];1019btn2007vista.onclick = function() {1020 modal2007vista.style.display = "block";1021}1022span2007vista.onclick = function() {1023 modal2007vista.style.display = "none";1024}1025window.onclick = function(event) {1026 if (event.target == modal2007vista) {1027 modal2007vista.style.display = "none";1028 }1029}1030/*------------------------------Modal 2007 office------------------------*/1031var modal2007office = document.getElementById("modal_2007_office");1032var btn2007office = document.getElementById("btn_modal_office_2007");1033var span2007office = document.getElementsByClassName("closeoffice2007")[0];1034btn2007office.onclick = function() {1035 modal2007office.style.display = "block";1036}1037span2007office.onclick = function() {1038 modal2007office.style.display = "none";1039}1040window.onclick = function(event) {1041 if (event.target == modal2007office) {1042 modal2007office.style.display = "none";1043 }1044}10451046/*------------------------------Modal 2007 macos105------------------------*/1047var modal2007macos105 = document.getElementById("modal_2007_macos105");1048var btn2007macos105 = document.getElementById("btn_modal_macos105_2007");1049var span2007macos105 = document.getElementsByClassName("closemacos1052007")[0];1050btn2007macos105.onclick = function() {1051 modal2007macos105.style.display = "block";1052}1053span2007macos105.onclick = function() {1054 modal2007macos105.style.display = "none";1055}1056window.onclick = function(event) {1057 if (event.target == modal2007macos105) {1058 modal2007macos105.style.display = "none";1059 }1060}10611062/*------------------------------Modal 2008 appletv------------------------*/1063var modal2008appletv = document.getElementById("modal_2008_appletv");1064var btn2008appletv = document.getElementById("btn_modal_appletv_2008");1065var span2008appletv = document.getElementsByClassName("closeappletv2008")[0];1066btn2008appletv.onclick = function() {1067 modal2008appletv.style.display = "block";1068}1069span2008appletv.onclick = function() {1070 modal2008appletv.style.display = "none";1071}1072window.onclick = function(event) {1073 if (event.target == modal2008appletv) {1074 modal2008appletv.style.display = "none";1075 }1076}1077/*------------------------------Modal 2008 firefox3------------------------*/1078var modal2008firefox3 = document.getElementById("modal_2008_firefox3");1079var btn2008firefox3 = document.getElementById("btn_modal_firefox3_2008");1080var span2008firefox3 = document.getElementsByClassName("closefirefox32008")[0];1081btn2008firefox3.onclick = function() {1082 modal2008firefox3.style.display = "block";1083}1084span2008firefox3.onclick = function() {1085 modal2008firefox3.style.display = "none";1086}1087window.onclick = function(event) {1088 if (event.target == modal2008firefox3) {1089 modal2008firefox3.style.display = "none";1090 }1091}10921093/*------------------------------Modal 2008 openoffice3------------------------*/1094var modal2008openoffice3 = document.getElementById("modal_2008_openoffice3");1095var btn2008openoffice3 = document.getElementById("btn_modal_openoffice3_2008");1096var span2008openoffice3 = document.getElementsByClassName("closeopenoffice32008")[0];1097btn2008openoffice3.onclick = function() {1098 modal2008openoffice3.style.display = "block";1099}1100span2008openoffice3.onclick = function() {1101 modal2008openoffice3.style.display = "none";1102}1103window.onclick = function(event) {1104 if (event.target == modal2008openoffice3) {1105 modal2008openoffice3.style.display = "none";1106 }1107}11081109/*------------------------------Modal 2009 bitcoin------------------------*/1110var modal2009bitcoin = document.getElementById("modal_2009_bitcoin");1111var btn2009bitcoin= document.getElementById("btn_modal_bitcoin_2009");1112var span2009bitcoin = document.getElementsByClassName("closebitcoin2009")[0];1113btn2009bitcoin.onclick = function() {1114 modal2009bitcoin.style.display = "block";1115}1116span2009bitcoin.onclick = function() {1117 modal2009bitcoin.style.display = "none";1118}1119window.onclick = function(event) {1120 if (event.target == modal2009bitcoin) {1121 modal2009bitcoin.style.display = "none";1122 }1123}11241125/*------------------------------Modal 2010 cloud------------------------*/1126var modal2010cloud = document.getElementById("modal_2010_cloud");1127var btn2010cloud = document.getElementById("btn_modal_cloud_2010");1128var span2010cloud = document.getElementsByClassName("closecloud2010")[0];1129btn2010cloud.onclick = function() {1130 modal2010cloud.style.display = "block";1131}1132span2010cloud.onclick = function() {1133 modal2010cloud.style.display = "none";1134}1135window.onclick = function(event) {1136 if (event.target == modal2010cloud) {1137 modal2010cloud.style.display = "none";1138 }1139}11401141/*------------------------------Modal 2011 libreoffice------------------------*/1142var modal2011libreoffice = document.getElementById("modal_2011_libreoffice");1143var btn2011libreoffice = document.getElementById("btn_modal_libreoffice_2011");1144var span2011libreoffice = document.getElementsByClassName("closelibreoffice2011")[0];1145btn2011libreoffice.onclick = function() {1146 modal2011libreoffice.style.display = "block";1147}1148span2011libreoffice.onclick = function() {1149 modal2011libreoffice.style.display = "none";1150}1151window.onclick = function(event) {1152 if (event.target == modal2011libreoffice) {1153 modal2011libreoffice.style.display = "none";1154 }1155}11561157/*------------------------------Modal 2012 windows8------------------------*/1158var modal2012windows8 = document.getElementById("modal_2012_windows8");1159var btn2012windows8 = document.getElementById("btn_modal_windows8_2012");1160var span2012windows8 = document.getElementsByClassName("closewindows82012")[0];1161btn2012windows8.onclick = function() {1162 modal2012windows8.style.display = "block";1163}1164span2012windows8.onclick = function() {1165 modal2012windows8.style.display = "none";1166}1167window.onclick = function(event) {1168 if (event.target == modal2012windows8) {1169 modal2012windows8.style.display = "none";1170 }1171}11721173/*------------------------------Modal 2013 smartpc------------------------*/1174var modal2013smartpc = document.getElementById("modal_2013_smartpc");1175var btn2013smartpc = document.getElementById("btn_modal_smartpc_2013");1176var span2013smartpc = document.getElementsByClassName("closesmartpc2013")[0];1177btn2013smartpc.onclick = function() {1178 modal2013smartpc.style.display = "block";1179}1180span2013smartpc.onclick = function() {1181 modal2013smartpc.style.display = "none";1182}1183window.onclick = function(event) {1184 if (event.target == modal2013smartpc) {1185 modal2013smartpc.style.display = "none";1186 }1187}1188/*------------------------------Modal 2013 snowden------------------------*/1189var modal2013snowden = document.getElementById("modal_2013_snowden");1190var btn2013snowden = document.getElementById("btn_modal_snowden_2013");1191var span2013snowden = document.getElementsByClassName("closesnowden2013")[0];1192btn2013snowden.onclick = function() {1193 modal2013snowden.style.display = "block";1194}1195span2013snowden.onclick = function() {1196 modal2013snowden.style.display = "none";1197}1198window.onclick = function(event) {1199 if (event.target == modal2013snowden) {1200 modal2013snowden.style.display = "none";1201 }1202}12031204/*------------------------------Modal 2014 objetcon------------------------*/1205var modal2014objetcon = document.getElementById("modal_2014_objetcon");1206var btn2014objetcon = document.getElementById("btn_modal_objetcon_2014");1207var span2014objetcon = document.getElementsByClassName("closeobjetcon2014")[0];1208btn2014objetcon.onclick = function() {1209 modal2014objetcon.style.display = "block";1210}1211span2014objetcon.onclick = function() {1212 modal2014objetcon.style.display = "none";1213}1214window.onclick = function(event) {1215 if (event.target == modal2014objetcon) {1216 modal2014objetcon.style.display = "none";1217 }1218}12191220/*------------------------------Modal 2015 darknet------------------------*/1221var modal2015darknet = document.getElementById("modal_2015_darknet");1222var btn2015darknet = document.getElementById("btn_modal_darknet_2015");1223var span2015darknet = document.getElementsByClassName("closedarknet2015")[0];1224btn2015darknet.onclick = function() {1225 modal2015darknet.style.display = "block";1226}1227span2015darknet.onclick = function() {1228 modal2015darknet.style.display = "none";1229}1230window.onclick = function(event) {1231 if (event.target == modal2015darknet) {1232 modal2015darknet.style.display = "none";1233 }1234}12351236/*------------------------------Modal 2016 chrome------------------------*/1237var modal2016chrome = document.getElementById("modal_2016_chrome");1238var btn2016chrome = document.getElementById("btn_modal_chrome_2016");1239var span2016chrome = document.getElementsByClassName("closechrome2016")[0];1240btn2016chrome.onclick = function() {1241 modal2016chrome.style.display = "block";1242}1243span2016chrome.onclick = function() {1244 modal2016chrome.style.display = "none";1245}1246window.onclick = function(event) {1247 if (event.target == modal2016chrome) {1248 modal2016chrome.style.display = "none";1249 }1250}12511252/*------------------------------Modal 2016 internetobj------------------------*/1253var modal2016internetobj = document.getElementById("modal_2016_internetobj");1254var btn2016internetobj = document.getElementById("btn_modal_internetobj_2016");1255var span2016internetobj = document.getElementsByClassName("closeinternetobj2016")[0];1256btn2016internetobj.onclick = function() {1257 modal2016internetobj.style.display = "block";1258}1259span2016internetobj.onclick = function() {1260 modal2016internetobj.style.display = "none";1261}1262window.onclick = function(event) {1263 if (event.target == modal2016internetobj) {1264 modal2016internetobj.style.display = "none";1265 }1266}1267/*------------------------------Modal 2017 wannacry------------------------*/1268var modal2017wannacry = document.getElementById("modal_2017_wannacry");1269var btn2017wannacry = document.getElementById("btn_modal_wannacry_2017");1270var span2017wannacry = document.getElementsByClassName("closewannacry2017")[0];1271btn2017wannacry.onclick = function() {1272 modal2017wannacry.style.display = "block";1273}1274span2017wannacry.onclick = function() {1275 modal2017wannacry.style.display = "none";1276}1277window.onclick = function(event) {1278 if (event.target == modal2017wannacry) {1279 modal2017wannacry.style.display = "none";1280 }1281}12821283/*------------------------------Modal 2018 canalytica------------------------*/1284var modal2018canalytica = document.getElementById("modal_2018_canalytica");1285var btn2018canalytica = document.getElementById("btn_modal_canalytica_2018");1286var span2018canalytica = document.getElementsByClassName("closecanalytica2018")[0];1287btn2018canalytica.onclick = function() {1288 modal2018canalytica.style.display = "block";1289}1290span2018canalytica.onclick = function() {1291 modal2018canalytica.style.display = "none";1292}1293window.onclick = function(event) {1294 if (event.target == modal2018canalytica) {1295 modal2018canalytica.style.display = "none";1296 }1297}12981299/*------------------------------Modal 2019 lexar------------------------*/1300var modal2019lexar = document.getElementById("modal_2019_lexar");1301var btn2019lexar = document.getElementById("btn_modal_lexar_2019");1302var span2019lexar = document.getElementsByClassName("closelexar2019")[0];1303btn2019lexar.onclick = function() {1304 modal2019lexar.style.display = "block";1305}1306span2019lexar.onclick = function() {1307 modal2019lexar.style.display = "none";1308}1309window.onclick = function(event) {1310 if (event.target == modal2019lexar) {1311 modal2019lexar.style.display = "none";1312 }1313}13141315/*------------------------------Modal 2019 google------------------------*/1316var modal2019google = document.getElementById("modal_2019_google");1317var btn2019google = document.getElementById("btn_modal_google_2019");1318var span2019google = document.getElementsByClassName("closegoogle2019")[0];1319btn2019google.onclick = function() {1320 modal2019google.style.display = "block";1321}1322span2019google.onclick = function() {1323 modal2019google.style.display = "none";1324}1325window.onclick = function(event) {1326 if (event.target == modal2019google) {1327 modal2019google.style.display = "none";1328 }1329}13301331/*------------------------------Modal 2020 covid------------------------*/1332var modal2020covid = document.getElementById("modal_2020_covid");1333var btn2020covid = document.getElementById("btn_modal_covid_2020");1334var span2020covid = document.getElementsByClassName("closecovid2020")[0];1335btn2020covid.onclick = function() {1336 modal2020covid.style.display = "block";1337}1338span2020covid.onclick = function() {1339 modal2020covid.style.display = "none";1340}1341window.onclick = function(event) {1342 if (event.target == modal2020covid) {1343 modal2020covid.style.display = "none";1344 } ...

Full Screen

Full Screen

no-static-element-interactions-test.js

Source:no-static-element-interactions-test.js Github

copy

Full Screen

1/* eslint-env jest */2/**3 * @fileoverview Enforce static elements have no interactive handlers.4 * @author Ethan Cohen5 */6// -----------------------------------------------------------------------------7// Requirements8// -----------------------------------------------------------------------------9import { RuleTester } from 'eslint';10import { configs } from '../../../src/index';11import parserOptionsMapper from '../../__util__/parserOptionsMapper';12import rule from '../../../src/rules/no-static-element-interactions';13import ruleOptionsMapperFactory from '../../__util__/ruleOptionsMapperFactory';14// -----------------------------------------------------------------------------15// Tests16// -----------------------------------------------------------------------------17const ruleTester = new RuleTester();18const errorMessage =19 'Static HTML elements with event handlers require a role.';20const expectedError = {21 message: errorMessage,22 type: 'JSXOpeningElement',23};24const ruleName = 'no-static-element-interactions';25const alwaysValid = [26 { code: '<TestComponent onClick={doFoo} />' },27 { code: '<Button onClick={doFoo} />' },28 { code: '<div />;' },29 { code: '<div className="foo" />;' },30 { code: '<div className="foo" {...props} />;' },31 { code: '<div onClick={() => void 0} aria-hidden />;' },32 { code: '<div onClick={() => void 0} aria-hidden={true} />;' },33 { code: '<div onClick={null} />;' },34 /* All flavors of input */35 { code: '<input onClick={() => void 0} />' },36 { code: '<input type="button" onClick={() => void 0} />' },37 { code: '<input type="checkbox" onClick={() => void 0} />' },38 { code: '<input type="color" onClick={() => void 0} />' },39 { code: '<input type="date" onClick={() => void 0} />' },40 { code: '<input type="datetime" onClick={() => void 0} />' },41 { code: '<input type="datetime-local" onClick={() => void 0} />' },42 { code: '<input type="email" onClick={() => void 0} />' },43 { code: '<input type="file" onClick={() => void 0} />' },44 { code: '<input type="hidden" onClick={() => void 0} />' },45 { code: '<input type="image" onClick={() => void 0} />' },46 { code: '<input type="month" onClick={() => void 0} />' },47 { code: '<input type="number" onClick={() => void 0} />' },48 { code: '<input type="password" onClick={() => void 0} />' },49 { code: '<input type="radio" onClick={() => void 0} />' },50 { code: '<input type="range" onClick={() => void 0} />' },51 { code: '<input type="reset" onClick={() => void 0} />' },52 { code: '<input type="search" onClick={() => void 0} />' },53 { code: '<input type="submit" onClick={() => void 0} />' },54 { code: '<input type="tel" onClick={() => void 0} />' },55 { code: '<input type="text" onClick={() => void 0} />' },56 { code: '<input type="time" onClick={() => void 0} />' },57 { code: '<input type="url" onClick={() => void 0} />' },58 { code: '<input type="week" onClick={() => void 0} />' },59 /* End all flavors of input */60 { code: '<button onClick={() => void 0} className="foo" />' },61 { code: '<menuitem onClick={() => {}} />;' },62 { code: '<option onClick={() => void 0} className="foo" />' },63 { code: '<select onClick={() => void 0} className="foo" />' },64 { code: '<textarea onClick={() => void 0} className="foo" />' },65 { code: '<a onClick={() => void 0} href="http://x.y.z" />' },66 { code: '<a onClick={() => void 0} href="http://x.y.z" tabIndex="0" />' },67 { code: '<audio onClick={() => {}} />;' },68 { code: '<form onClick={() => {}} />;' },69 /* HTML elements attributed with an interactive role */70 { code: '<div role="button" onClick={() => {}} />;' },71 { code: '<div role="checkbox" onClick={() => {}} />;' },72 { code: '<div role="columnheader" onClick={() => {}} />;' },73 { code: '<div role="combobox" onClick={() => {}} />;' },74 { code: '<div role="form" onClick={() => {}} />;' },75 { code: '<div role="gridcell" onClick={() => {}} />;' },76 { code: '<div role="link" onClick={() => {}} />;' },77 { code: '<div role="menuitem" onClick={() => {}} />;' },78 { code: '<div role="menuitemcheckbox" onClick={() => {}} />;' },79 { code: '<div role="menuitemradio" onClick={() => {}} />;' },80 { code: '<div role="option" onClick={() => {}} />;' },81 { code: '<div role="radio" onClick={() => {}} />;' },82 { code: '<div role="rowheader" onClick={() => {}} />;' },83 { code: '<div role="searchbox" onClick={() => {}} />;' },84 { code: '<div role="slider" onClick={() => {}} />;' },85 { code: '<div role="spinbutton" onClick={() => {}} />;' },86 { code: '<div role="switch" onClick={() => {}} />;' },87 { code: '<div role="tab" onClick={() => {}} />;' },88 { code: '<div role="textbox" onClick={() => {}} />;' },89 { code: '<div role="treeitem" onClick={() => {}} />;' },90 /* Presentation is a special case role that indicates intentional static semantics */91 { code: '<div role="presentation" onClick={() => {}} />;' },92 /* HTML elements with an inherent, non-interactive role */93 { code: '<main onClick={() => void 0} />;' },94 { code: '<article onClick={() => {}} />;' },95 { code: '<article onDblClick={() => void 0} />;' },96 { code: '<blockquote onClick={() => {}} />;' },97 { code: '<br onClick={() => {}} />;' },98 { code: '<canvas onClick={() => {}} />;' },99 { code: '<caption onClick={() => {}} />;' },100 { code: '<details onClick={() => {}} />;' },101 { code: '<dd onClick={() => {}} />;' },102 { code: '<dfn onClick={() => {}} />;' },103 { code: '<dir onClick={() => {}} />;' },104 { code: '<dl onClick={() => {}} />;' },105 { code: '<dt onClick={() => {}} />;' },106 { code: '<embed onClick={() => {}} />;' },107 { code: '<fieldset onClick={() => {}} />;' },108 { code: '<figcaption onClick={() => {}} />;' },109 { code: '<figure onClick={() => {}} />;' },110 { code: '<footer onClick={() => {}} />;' },111 { code: '<frame onClick={() => {}} />;' },112 { code: '<h1 onClick={() => {}} />;' },113 { code: '<h2 onClick={() => {}} />;' },114 { code: '<h3 onClick={() => {}} />;' },115 { code: '<h4 onClick={() => {}} />;' },116 { code: '<h5 onClick={() => {}} />;' },117 { code: '<h6 onClick={() => {}} />;' },118 { code: '<hr onClick={() => {}} />;' },119 { code: '<iframe onClick={() => {}} />;' },120 { code: '<img onClick={() => {}} />;' },121 { code: '<label onClick={() => {}} />;' },122 { code: '<legend onClick={() => {}} />;' },123 { code: '<li onClick={() => {}} />;' },124 { code: '<link onClick={() => {}} />;' },125 { code: '<mark onClick={() => {}} />;' },126 { code: '<marquee onClick={() => {}} />;' },127 { code: '<menu onClick={() => {}} />;' },128 { code: '<meter onClick={() => {}} />;' },129 { code: '<nav onClick={() => {}} />;' },130 { code: '<ol onClick={() => {}} />;' },131 { code: '<p onClick={() => {}} />;' },132 { code: '<pre onClick={() => {}} />;' },133 { code: '<progress onClick={() => {}} />;' },134 { code: '<ruby onClick={() => {}} />;' },135 { code: '<table onClick={() => {}} />;' },136 { code: '<tbody onClick={() => {}} />;' },137 { code: '<tfoot onClick={() => {}} />;' },138 { code: '<th onClick={() => {}} />;' },139 { code: '<thead onClick={() => {}} />;' },140 { code: '<time onClick={() => {}} />;' },141 { code: '<tr onClick={() => {}} />;' },142 { code: '<video onClick={() => {}} />;' },143 { code: '<ul onClick={() => {}} />;' },144 /* HTML elements attributed with an abstract role */145 { code: '<div role="command" onClick={() => {}} />;' },146 { code: '<div role="composite" onClick={() => {}} />;' },147 { code: '<div role="input" onClick={() => {}} />;' },148 { code: '<div role="landmark" onClick={() => {}} />;' },149 { code: '<div role="range" onClick={() => {}} />;' },150 { code: '<div role="roletype" onClick={() => {}} />;' },151 { code: '<div role="section" onClick={() => {}} />;' },152 { code: '<div role="sectionhead" onClick={() => {}} />;' },153 { code: '<div role="select" onClick={() => {}} />;' },154 { code: '<div role="structure" onClick={() => {}} />;' },155 { code: '<div role="widget" onClick={() => {}} />;' },156 { code: '<div role="window" onClick={() => {}} />;' },157 /* HTML elements attributed with a non-interactive role */158 { code: '<div role="alert" onClick={() => {}} />;' },159 { code: '<div role="alertdialog" onClick={() => {}} />;' },160 { code: '<div role="application" onClick={() => {}} />;' },161 { code: '<div role="article" onClick={() => {}} />;' },162 { code: '<div role="banner" onClick={() => {}} />;' },163 { code: '<div role="cell" onClick={() => {}} />;' },164 { code: '<div role="complementary" onClick={() => {}} />;' },165 { code: '<div role="contentinfo" onClick={() => {}} />;' },166 { code: '<div role="definition" onClick={() => {}} />;' },167 { code: '<div role="dialog" onClick={() => {}} />;' },168 { code: '<div role="directory" onClick={() => {}} />;' },169 { code: '<div role="document" onClick={() => {}} />;' },170 { code: '<div role="feed" onClick={() => {}} />;' },171 { code: '<div role="figure" onClick={() => {}} />;' },172 { code: '<div role="grid" onClick={() => {}} />;' },173 { code: '<div role="group" onClick={() => {}} />;' },174 { code: '<div role="heading" onClick={() => {}} />;' },175 { code: '<div role="img" onClick={() => {}} />;' },176 { code: '<div role="list" onClick={() => {}} />;' },177 { code: '<div role="listbox" onClick={() => {}} />;' },178 { code: '<div role="listitem" onClick={() => {}} />;' },179 { code: '<div role="log" onClick={() => {}} />;' },180 { code: '<div role="main" onClick={() => {}} />;' },181 { code: '<div role="marquee" onClick={() => {}} />;' },182 { code: '<div role="math" onClick={() => {}} />;' },183 { code: '<div role="menu" onClick={() => {}} />;' },184 { code: '<div role="menubar" onClick={() => {}} />;' },185 { code: '<div role="navigation" onClick={() => {}} />;' },186 { code: '<div role="note" onClick={() => {}} />;' },187 { code: '<div role="progressbar" onClick={() => {}} />;' },188 { code: '<div role="radiogroup" onClick={() => {}} />;' },189 { code: '<div role="region" onClick={() => {}} />;' },190 { code: '<div role="row" onClick={() => {}} />;' },191 { code: '<div role="rowgroup" onClick={() => {}} />;' },192 { code: '<div role="search" onClick={() => {}} />;' },193 { code: '<div role="separator" onClick={() => {}} />;' },194 { code: '<div role="scrollbar" onClick={() => {}} />;' },195 { code: '<div role="status" onClick={() => {}} />;' },196 { code: '<div role="table" onClick={() => {}} />;' },197 { code: '<div role="tablist" onClick={() => {}} />;' },198 { code: '<div role="tabpanel" onClick={() => {}} />;' },199 { code: '<td onClick={() => {}} />;' },200 { code: '<div role="term" onClick={() => {}} />;' },201 { code: '<div role="timer" onClick={() => {}} />;' },202 { code: '<div role="toolbar" onClick={() => {}} />;' },203 { code: '<div role="tooltip" onClick={() => {}} />;' },204 { code: '<div role="tree" onClick={() => {}} />;' },205 { code: '<div role="treegrid" onClick={() => {}} />;' },206];207const neverValid = [208 { code: '<div onClick={() => void 0} />;', errors: [expectedError] },209 { code: '<div onClick={() => void 0} role={undefined} />;', errors: [expectedError] },210 { code: '<div onClick={() => void 0} {...props} />;', errors: [expectedError] },211 { code: '<div onKeyUp={() => void 0} aria-hidden={false} />;', errors: [expectedError] },212 /* Static elements; no inherent role */213 { code: '<a onClick={() => void 0} />', errors: [expectedError] },214 { code: '<a onClick={() => {}} />;', errors: [expectedError] },215 { code: '<a tabIndex="0" onClick={() => void 0} />', errors: [expectedError] },216 { code: '<area onClick={() => {}} />;', errors: [expectedError] },217 { code: '<acronym onClick={() => {}} />;', errors: [expectedError] },218 { code: '<address onClick={() => {}} />;', errors: [expectedError] },219 { code: '<applet onClick={() => {}} />;', errors: [expectedError] },220 { code: '<aside onClick={() => {}} />;', errors: [expectedError] },221 { code: '<b onClick={() => {}} />;', errors: [expectedError] },222 { code: '<base onClick={() => {}} />;', errors: [expectedError] },223 { code: '<bdi onClick={() => {}} />;', errors: [expectedError] },224 { code: '<bdo onClick={() => {}} />;', errors: [expectedError] },225 { code: '<big onClick={() => {}} />;', errors: [expectedError] },226 { code: '<blink onClick={() => {}} />;', errors: [expectedError] },227 { code: '<body onClick={() => {}} />;', errors: [expectedError] },228 { code: '<center onClick={() => {}} />;', errors: [expectedError] },229 { code: '<cite onClick={() => {}} />;', errors: [expectedError] },230 { code: '<code onClick={() => {}} />;', errors: [expectedError] },231 { code: '<col onClick={() => {}} />;', errors: [expectedError] },232 { code: '<colgroup onClick={() => {}} />;', errors: [expectedError] },233 { code: '<content onClick={() => {}} />;', errors: [expectedError] },234 { code: '<data onClick={() => {}} />;', errors: [expectedError] },235 { code: '<datalist onClick={() => {}} />;', errors: [expectedError] },236 { code: '<del onClick={() => {}} />;', errors: [expectedError] },237 { code: '<div onClick={() => {}} />;', errors: [expectedError] },238 { code: '<em onClick={() => {}} />;', errors: [expectedError] },239 { code: '<font onClick={() => {}} />;', errors: [expectedError] },240 { code: '<frameset onClick={() => {}} />;', errors: [expectedError] },241 { code: '<head onClick={() => {}} />;', errors: [expectedError] },242 { code: '<header onClick={() => {}} />;', errors: [expectedError] },243 { code: '<hgroup onClick={() => {}} />;', errors: [expectedError] },244 { code: '<html onClick={() => {}} />;', errors: [expectedError] },245 { code: '<i onClick={() => {}} />;', errors: [expectedError] },246 { code: '<ins onClick={() => {}} />;', errors: [expectedError] },247 { code: '<kbd onClick={() => {}} />;', errors: [expectedError] },248 { code: '<keygen onClick={() => {}} />;', errors: [expectedError] },249 { code: '<map onClick={() => {}} />;', errors: [expectedError] },250 { code: '<meta onClick={() => {}} />;', errors: [expectedError] },251 { code: '<noembed onClick={() => {}} />;', errors: [expectedError] },252 { code: '<noscript onClick={() => {}} />;', errors: [expectedError] },253 { code: '<object onClick={() => {}} />;', errors: [expectedError] },254 { code: '<optgroup onClick={() => {}} />;', errors: [expectedError] },255 { code: '<output onClick={() => {}} />;', errors: [expectedError] },256 { code: '<param onClick={() => {}} />;', errors: [expectedError] },257 { code: '<picture onClick={() => {}} />;', errors: [expectedError] },258 { code: '<q onClick={() => {}} />;', errors: [expectedError] },259 { code: '<rp onClick={() => {}} />;', errors: [expectedError] },260 { code: '<rt onClick={() => {}} />;', errors: [expectedError] },261 { code: '<rtc onClick={() => {}} />;', errors: [expectedError] },262 { code: '<s onClick={() => {}} />;', errors: [expectedError] },263 { code: '<samp onClick={() => {}} />;', errors: [expectedError] },264 { code: '<script onClick={() => {}} />;', errors: [expectedError] },265 { code: '<section onClick={() => {}} />;', errors: [expectedError] },266 { code: '<small onClick={() => {}} />;', errors: [expectedError] },267 { code: '<source onClick={() => {}} />;', errors: [expectedError] },268 { code: '<spacer onClick={() => {}} />;', errors: [expectedError] },269 { code: '<span onClick={() => {}} />;', errors: [expectedError] },270 { code: '<strike onClick={() => {}} />;', errors: [expectedError] },271 { code: '<strong onClick={() => {}} />;', errors: [expectedError] },272 { code: '<style onClick={() => {}} />;', errors: [expectedError] },273 { code: '<sub onClick={() => {}} />;', errors: [expectedError] },274 { code: '<summary onClick={() => {}} />;', errors: [expectedError] },275 { code: '<sup onClick={() => {}} />;', errors: [expectedError] },276 { code: '<title onClick={() => {}} />;', errors: [expectedError] },277 { code: '<track onClick={() => {}} />;', errors: [expectedError] },278 { code: '<tt onClick={() => {}} />;', errors: [expectedError] },279 { code: '<u onClick={() => {}} />;', errors: [expectedError] },280 { code: '<var onClick={() => {}} />;', errors: [expectedError] },281 { code: '<wbr onClick={() => {}} />;', errors: [expectedError] },282 { code: '<xmp onClick={() => {}} />;', errors: [expectedError] },283];284const recommendedOptions =285 (configs.recommended.rules[`jsx-a11y/${ruleName}`][1] || {});286ruleTester.run(`${ruleName}:recommended`, rule, {287 valid: [288 ...alwaysValid,289 // All the possible handlers290 { code: '<div onCopy={() => {}} />;' },291 { code: '<div onCut={() => {}} />;' },292 { code: '<div onPaste={() => {}} />;' },293 { code: '<div onCompositionEnd={() => {}} />;' },294 { code: '<div onCompositionStart={() => {}} />;' },295 { code: '<div onCompositionUpdate={() => {}} />;' },296 { code: '<div onFocus={() => {}} />;' },297 { code: '<div onBlur={() => {}} />;' },298 { code: '<div onChange={() => {}} />;' },299 { code: '<div onInput={() => {}} />;' },300 { code: '<div onSubmit={() => {}} />;' },301 { code: '<div onContextMenu={() => {}} />;' },302 { code: '<div onDblClick={() => {}} />;' },303 { code: '<div onDoubleClick={() => {}} />;' },304 { code: '<div onDrag={() => {}} />;' },305 { code: '<div onDragEnd={() => {}} />;' },306 { code: '<div onDragEnter={() => {}} />;' },307 { code: '<div onDragExit={() => {}} />;' },308 { code: '<div onDragLeave={() => {}} />;' },309 { code: '<div onDragOver={() => {}} />;' },310 { code: '<div onDragStart={() => {}} />;' },311 { code: '<div onDrop={() => {}} />;' },312 { code: '<div onMouseEnter={() => {}} />;' },313 { code: '<div onMouseLeave={() => {}} />;' },314 { code: '<div onMouseMove={() => {}} />;' },315 { code: '<div onMouseOut={() => {}} />;' },316 { code: '<div onMouseOver={() => {}} />;' },317 { code: '<div onSelect={() => {}} />;' },318 { code: '<div onTouchCancel={() => {}} />;' },319 { code: '<div onTouchEnd={() => {}} />;' },320 { code: '<div onTouchMove={() => {}} />;' },321 { code: '<div onTouchStart={() => {}} />;' },322 { code: '<div onScroll={() => {}} />;' },323 { code: '<div onWheel={() => {}} />;' },324 { code: '<div onAbort={() => {}} />;' },325 { code: '<div onCanPlay={() => {}} />;' },326 { code: '<div onCanPlayThrough={() => {}} />;' },327 { code: '<div onDurationChange={() => {}} />;' },328 { code: '<div onEmptied={() => {}} />;' },329 { code: '<div onEncrypted={() => {}} />;' },330 { code: '<div onEnded={() => {}} />;' },331 { code: '<div onError={() => {}} />;' },332 { code: '<div onLoadedData={() => {}} />;' },333 { code: '<div onLoadedMetadata={() => {}} />;' },334 { code: '<div onLoadStart={() => {}} />;' },335 { code: '<div onPause={() => {}} />;' },336 { code: '<div onPlay={() => {}} />;' },337 { code: '<div onPlaying={() => {}} />;' },338 { code: '<div onProgress={() => {}} />;' },339 { code: '<div onRateChange={() => {}} />;' },340 { code: '<div onSeeked={() => {}} />;' },341 { code: '<div onSeeking={() => {}} />;' },342 { code: '<div onStalled={() => {}} />;' },343 { code: '<div onSuspend={() => {}} />;' },344 { code: '<div onTimeUpdate={() => {}} />;' },345 { code: '<div onVolumeChange={() => {}} />;' },346 { code: '<div onWaiting={() => {}} />;' },347 { code: '<div onLoad={() => {}} />;' },348 { code: '<div onError={() => {}} />;' },349 { code: '<div onAnimationStart={() => {}} />;' },350 { code: '<div onAnimationEnd={() => {}} />;' },351 { code: '<div onAnimationIteration={() => {}} />;' },352 { code: '<div onTransitionEnd={() => {}} />;' },353 ]354 .map(ruleOptionsMapperFactory(recommendedOptions))355 .map(parserOptionsMapper),356 invalid: [357 ...neverValid,358 // All the possible handlers359 { code: '<div onKeyDown={() => {}} />;', errors: [expectedError] },360 { code: '<div onKeyPress={() => {}} />;', errors: [expectedError] },361 { code: '<div onKeyUp={() => {}} />;', errors: [expectedError] },362 { code: '<div onClick={() => {}} />;', errors: [expectedError] },363 { code: '<div onMouseDown={() => {}} />;', errors: [expectedError] },364 { code: '<div onMouseUp={() => {}} />;', errors: [expectedError] },365 ]366 .map(ruleOptionsMapperFactory(recommendedOptions))367 .map(parserOptionsMapper),368});369ruleTester.run(`${ruleName}:strict`, rule, {370 valid: [371 ...alwaysValid,372 ].map(parserOptionsMapper),373 invalid: [374 ...neverValid,375 // All the possible handlers376 { code: '<div onCopy={() => {}} />;', errors: [expectedError] },377 { code: '<div onCut={() => {}} />;', errors: [expectedError] },378 { code: '<div onPaste={() => {}} />;', errors: [expectedError] },379 { code: '<div onCompositionEnd={() => {}} />;', errors: [expectedError] },380 { code: '<div onCompositionStart={() => {}} />;', errors: [expectedError] },381 { code: '<div onCompositionUpdate={() => {}} />;', errors: [expectedError] },382 { code: '<div onKeyDown={() => {}} />;', errors: [expectedError] },383 { code: '<div onKeyPress={() => {}} />;', errors: [expectedError] },384 { code: '<div onKeyUp={() => {}} />;', errors: [expectedError] },385 { code: '<div onFocus={() => {}} />;', errors: [expectedError] },386 { code: '<div onBlur={() => {}} />;', errors: [expectedError] },387 { code: '<div onChange={() => {}} />;', errors: [expectedError] },388 { code: '<div onInput={() => {}} />;', errors: [expectedError] },389 { code: '<div onSubmit={() => {}} />;', errors: [expectedError] },390 { code: '<div onClick={() => {}} />;', errors: [expectedError] },391 { code: '<div onContextMenu={() => {}} />;', errors: [expectedError] },392 { code: '<div onDblClick={() => {}} />;', errors: [expectedError] },393 { code: '<div onDoubleClick={() => {}} />;', errors: [expectedError] },394 { code: '<div onDrag={() => {}} />;', errors: [expectedError] },395 { code: '<div onDragEnd={() => {}} />;', errors: [expectedError] },396 { code: '<div onDragEnter={() => {}} />;', errors: [expectedError] },397 { code: '<div onDragExit={() => {}} />;', errors: [expectedError] },398 { code: '<div onDragLeave={() => {}} />;', errors: [expectedError] },399 { code: '<div onDragOver={() => {}} />;', errors: [expectedError] },400 { code: '<div onDragStart={() => {}} />;', errors: [expectedError] },401 { code: '<div onDrop={() => {}} />;', errors: [expectedError] },402 { code: '<div onMouseDown={() => {}} />;', errors: [expectedError] },403 { code: '<div onMouseEnter={() => {}} />;', errors: [expectedError] },404 { code: '<div onMouseLeave={() => {}} />;', errors: [expectedError] },405 { code: '<div onMouseMove={() => {}} />;', errors: [expectedError] },406 { code: '<div onMouseOut={() => {}} />;', errors: [expectedError] },407 { code: '<div onMouseOver={() => {}} />;', errors: [expectedError] },408 { code: '<div onMouseUp={() => {}} />;', errors: [expectedError] },409 { code: '<div onSelect={() => {}} />;', errors: [expectedError] },410 { code: '<div onTouchCancel={() => {}} />;', errors: [expectedError] },411 { code: '<div onTouchEnd={() => {}} />;', errors: [expectedError] },412 { code: '<div onTouchMove={() => {}} />;', errors: [expectedError] },413 { code: '<div onTouchStart={() => {}} />;', errors: [expectedError] },414 { code: '<div onScroll={() => {}} />;', errors: [expectedError] },415 { code: '<div onWheel={() => {}} />;', errors: [expectedError] },416 { code: '<div onAbort={() => {}} />;', errors: [expectedError] },417 { code: '<div onCanPlay={() => {}} />;', errors: [expectedError] },418 { code: '<div onCanPlayThrough={() => {}} />;', errors: [expectedError] },419 { code: '<div onDurationChange={() => {}} />;', errors: [expectedError] },420 { code: '<div onEmptied={() => {}} />;', errors: [expectedError] },421 { code: '<div onEncrypted={() => {}} />;', errors: [expectedError] },422 { code: '<div onEnded={() => {}} />;', errors: [expectedError] },423 { code: '<div onError={() => {}} />;', errors: [expectedError] },424 { code: '<div onLoadedData={() => {}} />;', errors: [expectedError] },425 { code: '<div onLoadedMetadata={() => {}} />;', errors: [expectedError] },426 { code: '<div onLoadStart={() => {}} />;', errors: [expectedError] },427 { code: '<div onPause={() => {}} />;', errors: [expectedError] },428 { code: '<div onPlay={() => {}} />;', errors: [expectedError] },429 { code: '<div onPlaying={() => {}} />;', errors: [expectedError] },430 { code: '<div onProgress={() => {}} />;', errors: [expectedError] },431 { code: '<div onRateChange={() => {}} />;', errors: [expectedError] },432 { code: '<div onSeeked={() => {}} />;', errors: [expectedError] },433 { code: '<div onSeeking={() => {}} />;', errors: [expectedError] },434 { code: '<div onStalled={() => {}} />;', errors: [expectedError] },435 { code: '<div onSuspend={() => {}} />;', errors: [expectedError] },436 { code: '<div onTimeUpdate={() => {}} />;', errors: [expectedError] },437 { code: '<div onVolumeChange={() => {}} />;', errors: [expectedError] },438 { code: '<div onWaiting={() => {}} />;', errors: [expectedError] },439 { code: '<div onLoad={() => {}} />;', errors: [expectedError] },440 { code: '<div onError={() => {}} />;', errors: [expectedError] },441 { code: '<div onAnimationStart={() => {}} />;', errors: [expectedError] },442 { code: '<div onAnimationEnd={() => {}} />;', errors: [expectedError] },443 { code: '<div onAnimationIteration={() => {}} />;', errors: [expectedError] },444 { code: '<div onTransitionEnd={() => {}} />;', errors: [expectedError] },445 ].map(parserOptionsMapper),...

Full Screen

Full Screen

modal-innovation.js

Source:modal-innovation.js Github

copy

Full Screen

1/*------------------------------Modal 1974 8008------------------------*/2var modal19748008 = document.getElementById("modal_1974_8008");3var btn19748008 = document.getElementById("btn_modal_8008_1974");4var span19748008 = document.getElementsByClassName("close80081974")[0];5btn19748008.onclick = function() {6 modal19748008.style.display = "block";7}8span19748008.onclick = function() {9 modal19748008.style.display = "none";10}11window.onclick = function(event) {12 if (event.target == modal19748008) {13 modal19748008.style.display = "none";14 }15}16/*------------------------------Modal 1975 mos------------------------*/17var modal1975mos = document.getElementById("modal_1975_mos");18var btn1975mos = document.getElementById("btn_modal_mos_1975");19var span1975mos = document.getElementsByClassName("closemos1975")[0];20btn1975mos.onclick = function() {21 modal1975mos.style.display = "block";22}23span1975mos.onclick = function() {24 modal1975mos.style.display = "none";25}26window.onclick = function(event) {27 if (event.target == modal1975mos) {28 modal1975mos.style.display = "none";29 }30}31/*------------------------------Modal 1978 apple------------------------*/32var modal1978apple = document.getElementById("modal_1978_apple");33var btn1978apple = document.getElementById("btn_modal_apple_1978");34var span1978apple = document.getElementsByClassName("closeapple1978")[0];35btn1978apple.onclick = function() {36 modal1978apple.style.display = "block";37}38span1978apple.onclick = function() {39 modal1978apple.style.display = "none";40}41window.onclick = function(event) {42 if (event.target == modal1978apple) {43 modal1978apple.style.display = "none";44 }45}46/*------------------------------Modal 1979 trs------------------------*/47var modal1979trs = document.getElementById("modal_1979_trs");48var btn1979trs = document.getElementById("btn_modal_trs_1979");49var span1979trs = document.getElementsByClassName("closetrs1979")[0];50btn1979trs.onclick = function() {51 modal1979trs.style.display = "block";52}53span1979trs.onclick = function() {54 modal1979trs.style.display = "none";55}56window.onclick = function(event) {57 if (event.target == modal1979trs) {58 modal1979trs.style.display = "none";59 }60}61/*------------------------------Modal 1982 dos------------------------*/62var modal1982dos = document.getElementById("modal_1982_dos");63var btn1982dos = document.getElementById("btn_modal_dos_1982");64var span1982dos = document.getElementsByClassName("closedos1982")[0];65btn1982dos.onclick = function() {66 modal1982dos.style.display = "block";67}68span1982dos.onclick = function() {69 modal1982dos.style.display = "none";70}71window.onclick = function(event) {72 if (event.target == modal1982dos) {73 modal1982dos.style.display = "none";74 }75}76/*------------------------------Modal 1984 mac------------------------*/77var modal1984mac = document.getElementById("modal_1984_mac");78var btn1984mac = document.getElementById("btn_modal_mac_1984");79var span1984mac = document.getElementsByClassName("closemac1984")[0];80btn1984mac.onclick = function() {81 modal1984mac.style.display = "block";82}83span1984mac.onclick = function() {84 modal1984mac.style.display = "none";85}86window.onclick = function(event) {87 if (event.target == modal1984mac) {88 modal1984mac.style.display = "none";89 }90}91/*------------------------------Modal 1985 windows1------------------------*/92var modal1985windows1 = document.getElementById("modal_1985_windows1");93var btn1985windows1 = document.getElementById("btn_modal_windows1_1985");94var span1985windows1 = document.getElementsByClassName("closewindows11985")[0];95btn1985windows1.onclick = function() {96 modal1985windows1.style.display = "block";97}98span1985windows1.onclick = function() {99 modal1985windows1.style.display = "none";100}101window.onclick = function(event) {102 if (event.target == modal1985windows1) {103 modal1985windows1.style.display = "none";104 }105}106/*------------------------------Modal 1986 risc------------------------*/107var modal1986risc = document.getElementById("modal_1986_risc");108var btn1986risc = document.getElementById("btn_modal_risc_1986");109var span1986risc = document.getElementsByClassName("closerisc1986")[0];110btn1986risc.onclick = function() {111 modal1986risc.style.display = "block";112}113span1986risc.onclick = function() {114 modal1986risc.style.display = "none";115}116window.onclick = function(event) {117 if (event.target == modal1986risc) {118 modal1986risc.style.display = "none";119 }120}121/*------------------------------Modal 1987 windows2------------------------*/122var modal1987windows2 = document.getElementById("modal_1987_windows2");123var btn1987windows2 = document.getElementById("btn_modal_windows2_1987");124var span1987windows2 = document.getElementsByClassName("closewindows21987")[0];125btn1987windows2.onclick = function() {126 modal1987windows2.style.display = "block";127}128span1987windows2.onclick = function() {129 modal1987windows2.style.display = "none";130}131window.onclick = function(event) {132 if (event.target == modal1987windows2) {133 modal1987windows2.style.display = "none";134 }135}136/*------------------------------Modal 1988 as400------------------------*/137var modal1988as400 = document.getElementById("modal_1988_as400");138var btn1988as400 = document.getElementById("btn_modal_as400_1988");139var span1988as400 = document.getElementsByClassName("closeas4001988")[0];140btn1988as400.onclick = function() {141 modal1988as400.style.display = "block";142}143span1988as400.onclick = function() {144 modal1988as400.style.display = "none";145}146window.onclick = function(event) {147 if (event.target == modal1988as400) {148 modal1988as400.style.display = "none";149 }150}151/*------------------------------Modal 1989 nextstep------------------------*/152var modal1989nextstep = document.getElementById("modal_1989_nextstep");153var btn1989nextstep = document.getElementById("btn_modal_nextstep_1989");154var span1989nextstep = document.getElementsByClassName("closenextstep1989")[0];155btn1989nextstep.onclick = function() {156 modal1989nextstep.style.display = "block";157}158span1989nextstep.onclick = function() {159 modal1989nextstep.style.display = "none";160}161window.onclick = function(event) {162 if (event.target == modal1989nextstep) {163 modal1989nextstep.style.display = "none";164 }165}166/*------------------------------Modal 1991 apples7------------------------*/167var modal1991apples7 = document.getElementById("modal_1991_apples7");168var btn1991apples7 = document.getElementById("btn_modal_apples7_1991");169var span1991apples7 = document.getElementsByClassName("closeapples71991")[0];170btn1991apples7.onclick = function() {171 modal1991apples7.style.display = "block";172}173span1991apples7.onclick = function() {174 modal1991apples7.style.display = "none";175}176window.onclick = function(event) {177 if (event.target == modal1991apples7) {178 modal1991apples7.style.display = "none";179 }180}181/*------------------------------Modal 1992 windows3------------------------*/182var modal1992windows3 = document.getElementById("modal_1992_windows3");183var btn1992windows3 = document.getElementById("btn_modal_windows3_1992");184var span1992windows3 = document.getElementsByClassName("closewindows31992")[0];185btn1992windows3.onclick = function() {186 modal1992windows3.style.display = "block";187}188span1992windows3.onclick = function() {189 modal1992windows3.style.display = "none";190}191window.onclick = function(event) {192 if (event.target == modal1992windows3) {193 modal1992windows3.style.display = "none";194 }195}196/*------------------------------Modal 1993 pentium------------------------*/197var modal1993pentium = document.getElementById("modal_1993_pentium");198var btn1993pentium = document.getElementById("btn_modal_pentium_1993");199var span1993pentium = document.getElementsByClassName("closepentium1993")[0];200btn1993pentium.onclick = function() {201 modal1993pentium.style.display = "block";202}203span1993pentium.onclick = function() {204 modal1993pentium.style.display = "none";205}206window.onclick = function(event) {207 if (event.target == modal1993pentium) {208 modal1993pentium.style.display = "none";209 }210}211/*------------------------------Modal 1993 windowsnt------------------------*/212var modal1993windowsnt = document.getElementById("modal_1993_windowsnt");213var btn1993windowsnt = document.getElementById("btn_modal_windowsnt_1993");214var span1993windowsnt = document.getElementsByClassName("closewindowsnt1993")[0];215btn1993windowsnt.onclick = function() {216 modal1993windowsnt.style.display = "block";217}218span1993windowsnt.onclick = function() {219 modal1993windowsnt.style.display = "none";220}221window.onclick = function(event) {222 if (event.target == modal1993windowsnt) {223 modal1993windowsnt.style.display = "none";224 }225}226/*------------------------------Modal 1994 powermac------------------------*/227var modal1994powermac = document.getElementById("modal_1994_powermac");228var btn1994powermac = document.getElementById("btn_modal_powermac_1994");229var span1994powermac = document.getElementsByClassName("closepowermac1994")[0];230btn1994powermac.onclick = function() {231 modal1994powermac.style.display = "block";232}233span1994powermac.onclick = function() {234 modal1994powermac.style.display = "none";235}236window.onclick = function(event) {237 if (event.target == modal1994powermac) {238 modal1994powermac.style.display = "none";239 }240}241/*------------------------------Modal 1996 microsoft------------------------*/242var modal1996microsoft = document.getElementById("modal_1996_microsoft");243var btn1996microsoft = document.getElementById("btn_modal_microsoft_1996");244var span1996microsoft = document.getElementsByClassName("closemicrosoft1996")[0];245btn1996microsoft.onclick = function() {246 modal1996microsoft.style.display = "block";247}248span1996microsoft.onclick = function() {249 modal1996microsoft.style.display = "none";250}251window.onclick = function(event) {252 if (event.target == modal1996microsoft) {253 modal1996microsoft.style.display = "none";254 }255}256/*------------------------------Modal 1996 linux------------------------*/257var modal1996linux = document.getElementById("modal_1996_linux");258var btn1996linux = document.getElementById("btn_modal_linux_1996");259var span1996linux = document.getElementsByClassName("closelinux1996")[0];260btn1996linux.onclick = function() {261 modal1996linux.style.display = "block";262}263span1996linux.onclick = function() {264 modal1996linux.style.display = "none";265}266window.onclick = function(event) {267 if (event.target == modal1996linux) {268 modal1996linux.style.display = "none";269 }270}271/*------------------------------Modal 1997 macos8------------------------*/272var modal1997macos8 = document.getElementById("modal_1997_macos8");273var btn1997macos8 = document.getElementById("btn_modal_macos8_1997");274var span1997macos8 = document.getElementsByClassName("closemacos81997")[0];275btn1997macos8.onclick = function() {276 modal1997macos8.style.display = "block";277}278span1997macos8.onclick = function() {279 modal1997macos8.style.display = "none";280}281window.onclick = function(event) {282 if (event.target == modal1997macos8) {283 modal1997macos8.style.display = "none";284 }285}286/*------------------------------Modal 1998 windows98------------------------*/287var modal1998windows98 = document.getElementById("modal_1998_windows98");288var btn1998windows98 = document.getElementById("btn_modal_windows98_1998");289var span1998windows98 = document.getElementsByClassName("closewindows981998")[0];290btn1998windows98.onclick = function() {291 modal1998windows98.style.display = "block";292}293span1998windows98.onclick = function() {294 modal1998windows98.style.display = "none";295}296window.onclick = function(event) {297 if (event.target == modal1998windows98) {298 modal1998windows98.style.display = "none";299 }300}301/*------------------------------Modal 1999 linux22------------------------*/302var modal1999linux22 = document.getElementById("modal_1999_linux22");303var btn1999linux22 = document.getElementById("btn_modal_linux22_1999");304var span1999linux22 = document.getElementsByClassName("closelinux221999")[0];305btn1999linux22.onclick = function() {306 modal1999linux22.style.display = "block";307}308span1999linux22.onclick = function() {309 modal1999linux22.style.display = "none";310}311window.onclick = function(event) {312 if (event.target == modal1999linux22) {313 modal1999linux22.style.display = "none";314 }315}316/*------------------------------Modal 1999 macos9------------------------*/317var modal1999macos9 = document.getElementById("modal_1999_macos9");318var btn1999macos9 = document.getElementById("btn_modal_macos9_1999");319var span1999macos9 = document.getElementsByClassName("closemacos91999")[0];320btn1999macos9.onclick = function() {321 modal1999macos9.style.display = "block";322}323span1999macos9.onclick = function() {324 modal1999macos9.style.display = "none";325}326window.onclick = function(event) {327 if (event.target == modal1999macos9) {328 modal1999macos9.style.display = "none";329 }330}331/*------------------------------Modal 2000 microsoft------------------------*/332var modal2000microsoft = document.getElementById("modal_2000_microsoft");333var btn2000microsoft = document.getElementById("btn_modal_microsoft_2000");334var span2000microsoft = document.getElementsByClassName("closemicrosoft2000")[0];335btn2000microsoft.onclick = function() {336 modal2000microsoft.style.display = "block";337}338span2000microsoft.onclick = function() {339 modal2000microsoft.style.display = "none";340}341window.onclick = function(event) {342 if (event.target == modal2000microsoft) {343 modal2000microsoft.style.display = "none";344 }345}346/*------------------------------Modal 2003 powermac------------------------*/347var modal2003powermac = document.getElementById("modal_2003_powermac");348var btn2003powermac = document.getElementById("btn_modal_powermac_2003");349var span2003powermac = document.getElementsByClassName("closepowermac2003")[0];350btn2003powermac.onclick = function() {351 modal2003powermac.style.display = "block";352}353span2003powermac.onclick = function() {354 modal2003powermac.style.display = "none";355}356window.onclick = function(event) {357 if (event.target == modal2003powermac) {358 modal2003powermac.style.display = "none";359 }360}361/*------------------------------Modal 2004 linux26------------------------*/362var modal2004linux26 = document.getElementById("modal_2004_linux26");363var btn2004linux26 = document.getElementById("btn_modal_linux26_2004");364var span2004linux26 = document.getElementsByClassName("closelinux262004")[0];365btn2004linux26.onclick = function() {366 modal2004linux26.style.display = "block";367}368span2004linux26.onclick = function() {369 modal2004linux26.style.display = "none";370}371window.onclick = function(event) {372 if (event.target == modal2004linux26) {373 modal2004linux26.style.display = "none";374 }375}376/*------------------------------Modal 2006 iexplorer7------------------------*/377var modal2006iexplorer7 = document.getElementById("modal_2006_iexplorer7");378var btn2006iexplorer7 = document.getElementById("btn_modal_iexplorer7_2006");379var span2006iexplorer7 = document.getElementsByClassName("closeiexplorer72006")[0];380btn2006iexplorer7.onclick = function() {381 modal2006iexplorer7.style.display = "block";382}383span2006iexplorer7.onclick = function() {384 modal2006iexplorer7.style.display = "none";385}386window.onclick = function(event) {387 if (event.target == modal2006iexplorer7) {388 modal2006iexplorer7.style.display = "none";389 }390}391/*------------------------------Modal 2006 firefox------------------------*/392var modal2006firefox = document.getElementById("modal_2006_firefox");393var btn2006firefox = document.getElementById("btn_modal_firefox_2006");394var span2006firefox = document.getElementsByClassName("closefirefox2006")[0];395btn2006firefox.onclick = function() {396 modal2006firefox.style.display = "block";397}398span2006firefox.onclick = function() {399 modal2006firefox.style.display = "none";400}401window.onclick = function(event) {402 if (event.target == modal2006firefox) {403 modal2006firefox.style.display = "none";404 }405}406/*------------------------------Modal 2007 vista------------------------*/407var modal2007vista = document.getElementById("modal_2007_vista");408var btn2007vista = document.getElementById("btn_modal_vista_2007");409var span2007vista = document.getElementsByClassName("closevista2007")[0];410btn2007vista.onclick = function() {411 modal2007vista.style.display = "block";412}413span2007vista.onclick = function() {414 modal2007vista.style.display = "none";415}416window.onclick = function(event) {417 if (event.target == modal2007vista) {418 modal2007vista.style.display = "none";419 }420}421/*------------------------------Modal 2007 office------------------------*/422var modal2007office = document.getElementById("modal_2007_office");423var btn2007office = document.getElementById("btn_modal_office_2007");424var span2007office = document.getElementsByClassName("closeoffice2007")[0];425btn2007office.onclick = function() {426 modal2007office.style.display = "block";427}428span2007office.onclick = function() {429 modal2007office.style.display = "none";430}431window.onclick = function(event) {432 if (event.target == modal2007office) {433 modal2007office.style.display = "none";434 }435}436/*------------------------------Modal 2007 macos105------------------------*/437var modal2007macos105 = document.getElementById("modal_2007_macos105");438var btn2007macos105 = document.getElementById("btn_modal_macos105_2007");439var span2007macos105 = document.getElementsByClassName("closemacos1052007")[0];440btn2007macos105.onclick = function() {441 modal2007macos105.style.display = "block";442}443span2007macos105.onclick = function() {444 modal2007macos105.style.display = "none";445}446window.onclick = function(event) {447 if (event.target == modal2007macos105) {448 modal2007macos105.style.display = "none";449 }450}451/*------------------------------Modal 2008 appletv------------------------*/452var modal2008appletv = document.getElementById("modal_2008_appletv");453var btn2008appletv = document.getElementById("btn_modal_appletv_2008");454var span2008appletv = document.getElementsByClassName("closeappletv2008")[0];455btn2008appletv.onclick = function() {456 modal2008appletv.style.display = "block";457}458span2008appletv.onclick = function() {459 modal2008appletv.style.display = "none";460}461window.onclick = function(event) {462 if (event.target == modal2008appletv) {463 modal2008appletv.style.display = "none";464 }465}466/*------------------------------Modal 2008 firefox3------------------------*/467var modal2008firefox3 = document.getElementById("modal_2008_firefox3");468var btn2008firefox3 = document.getElementById("btn_modal_firefox3_2008");469var span2008firefox3 = document.getElementsByClassName("closefirefox32008")[0];470btn2008firefox3.onclick = function() {471 modal2008firefox3.style.display = "block";472}473span2008firefox3.onclick = function() {474 modal2008firefox3.style.display = "none";475}476window.onclick = function(event) {477 if (event.target == modal2008firefox3) {478 modal2008firefox3.style.display = "none";479 }480}481/*------------------------------Modal 2008 openoffice3------------------------*/482var modal2008openoffice3 = document.getElementById("modal_2008_openoffice3");483var btn2008openoffice3 = document.getElementById("btn_modal_openoffice3_2008");484var span2008openoffice3 = document.getElementsByClassName("closeopenoffice32008")[0];485btn2008openoffice3.onclick = function() {486 modal2008openoffice3.style.display = "block";487}488span2008openoffice3.onclick = function() {489 modal2008openoffice3.style.display = "none";490}491window.onclick = function(event) {492 if (event.target == modal2008openoffice3) {493 modal2008openoffice3.style.display = "none";494 }495}496/*------------------------------Modal 2012 windows8------------------------*/497var modal2012windows8 = document.getElementById("modal_2012_windows8");498var btn2012windows8 = document.getElementById("btn_modal_windows8_2012");499var span2012windows8 = document.getElementsByClassName("closewindows82012")[0];500btn2012windows8.onclick = function() {501 modal2012windows8.style.display = "block";502}503span2012windows8.onclick = function() {504 modal2012windows8.style.display = "none";505}506window.onclick = function(event) {507 if (event.target == modal2012windows8) {508 modal2012windows8.style.display = "none";509 }510}511/*------------------------------Modal 2019 lexar------------------------*/512var modal2019lexar = document.getElementById("modal_2019_lexar");513var btn2019lexar = document.getElementById("btn_modal_lexar_2019");514var span2019lexar = document.getElementsByClassName("closelexar2019")[0];515btn2019lexar.onclick = function() {516 modal2019lexar.style.display = "block";517}518span2019lexar.onclick = function() {519 modal2019lexar.style.display = "none";520}521window.onclick = function(event) {522 if (event.target == modal2019lexar) {523 modal2019lexar.style.display = "none";524 }525}526/*------------------------------Modal 2019 google------------------------*/527var modal2019google = document.getElementById("modal_2019_google");528var btn2019google = document.getElementById("btn_modal_google_2019");529var span2019google = document.getElementsByClassName("closegoogle2019")[0];530btn2019google.onclick = function() {531 modal2019google.style.display = "block";532}533span2019google.onclick = function() {534 modal2019google.style.display = "none";535}536window.onclick = function(event) {537 if (event.target == modal2019google) {538 modal2019google.style.display = "none";539 }...

Full Screen

Full Screen

Buttons.js

Source:Buttons.js Github

copy

Full Screen

...13 <div>14 <button15 className="jumbo"16 id="clear"17 onClick={(e) => onClick(e.target.value)}18 style={clearStyle}19 value="AC"20 >21 AC22 </button>23 <button24 id="divide"25 onClick={(e) => onClick(e.target.value)}26 style={operatorStyle}27 value="/"28 >29 /30 </button>31 <button32 id="multiply"33 onClick={(e) => onClick(e.target.value)}34 style={operatorStyle}35 value="*"36 >37 x38 </button>39 <button id={"seven"} onClick={(e) => onClick(e.target.value)} value="7">40 741 </button>42 <button id={"eight"} onClick={(e) => onClick(e.target.value)} value="8">43 844 </button>45 <button id={"nine"} onClick={(e) => onClick(e.target.value)} value="9">46 947 </button>48 <button49 id="subtract"50 onClick={(e) => onClick(e.target.value)}51 style={operatorStyle}52 value="-"53 >54 -55 </button>56 <button id={"four"} onClick={(e) => onClick(e.target.value)} value="4">57 458 </button>59 <button id={"five"} onClick={(e) => onClick(e.target.value)} value="5">60 561 </button>62 <button id={"six"} onClick={(e) => onClick(e.target.value)} value="6">63 664 </button>65 <button66 id="add"67 onClick={(e) => onClick(e.target.value)}68 style={operatorStyle}69 value="+"70 >71 +72 </button>73 <button id={"one"} onClick={(e) => onClick(e.target.value)} value="1">74 175 </button>76 <button id={"two"} onClick={(e) => onClick(e.target.value)} value="2">77 278 </button>79 <button id={"three"} onClick={(e) => onClick(e.target.value)} value="3">80 381 </button>82 <button83 id={"equals"}84 style={equalsStyle}85 onClick={(e) => onClick(e.target.value)}86 value="="87 >88 =89 </button>90 <button91 className="jumbo"92 id="zero"93 onClick={(e) => onClick(e.target.value)}94 value="0"95 >96 097 </button>98 <button id="decimal" onClick={(e) => onClick(e.target.value)} value=".">99 .100 </button>101 </div>102 );103};104Buttons.propTypes = {105 onClick: PropTypes.func.isRequired106};...

Full Screen

Full Screen

keyPad.js

Source:keyPad.js Github

copy

Full Screen

2import style from '../App.module.css'3const KeyPad= (props)=> {4 return (5 <div className={style.button}>6 <button name="(" onClick={e => props.onClick(e.target.name)}>(</button>7 <button name=")" onClick={e => props.onClick(e.target.name)}>)</button>8 <button name="CE" onClick={e => props.onClick(e.target.name)}>CE</button>9 <button name="C" onClick={e => props.onClick(e.target.name)}>C</button><br/>10 <button name="1" onClick={e => props.onClick(e.target.name)}>1</button>11 <button name="2" onClick={e => props.onClick(e.target.name)}>2</button>12 <button name="3" onClick={e => props.onClick(e.target.name)}>3</button>13 <button name="+" onClick={e => props.onClick(e.target.name)}>+</button><br/>14 <button name="4" onClick={e => props.onClick(e.target.name)}>4</button>15 <button name="5" onClick={e => props.onClick(e.target.name)}>5</button>16 <button name="6" onClick={e => props.onClick(e.target.name)}>6</button>17 <button name="-" onClick={e => props.onClick(e.target.name)}>-</button><br/>18 <button name="7" onClick={e => props.onClick(e.target.name)}>7</button>19 <button name="8" onClick={e => props.onClick(e.target.name)}>8</button>20 <button name="9" onClick={e => props.onClick(e.target.name)}>9</button>21 <button name="*" onClick={e => props.onClick(e.target.name)}>x</button><br/>22 <button name="." onClick={e => props.onClick(e.target.name)}>.</button>23 <button name="0" onClick={e => props.onClick(e.target.name)}>0</button>24 <button name="=" onClick={e => props.onClick(e.target.name)}>=</button>25 <button name="/" onClick={e => props.onClick(e.target.name)}>÷</button><br/>26 </div>27 );28}...

Full Screen

Full Screen

index.js

Source:index.js Github

copy

Full Screen

1import "./styles.css";2document.getElementById("board").innerHTML = `3<p id="player">Player 1</p>4<table style="width: 30%;">5<tr>6 <th id="11" onclick="myFunction()">-</th>7 <th id="12" onclick="myFunction()">-</th>8 <th id="13" onclick="myFunction()">-</th>9 <th id="14" onclick="myFunction()">-</th>10 <th id="15" onclick="myFunction()">-</th>11</tr>12<tr>13 <th id="21" onclick="myFunction()">-</th>14 <th id="22" onclick="myFunction()">-</th>15 <th id="23" onclick="myFunction()">-</th>16 <th id="24" onclick="myFunction()">-</th>17 <th id="25" onclick="myFunction()">-</th>18</tr>19<tr>20 <th id="31" onclick="myFunction()">-</th>21 <th id="32" onclick="myFunction()">-</th>22 <th id="33" onclick="myFunction()">-</th>23 <th id="34" onclick="myFunction()">-</th>24 <th id="35" onclick="myFunction()">-</th>25</tr>26<tr>27 <th id="41" onclick="myFunction()">-</th>28 <th id="42" onclick="myFunction()">-</th>29 <th id="43" onclick="myFunction()">-</th>30 <th id="44" onclick="myFunction()">-</th>31 <th id="45" onclick="myFunction()">-</th>32</tr>33<tr>34 <th id="51" onclick="myFunction()">-</th>35 <th id="52" onclick="myFunction()">-</th>36 <th id="53" onclick="myFunction()">-</th>37 <th id="54" onclick="myFunction()">-</th>38 <th id="55" onclick="myFunction()">-</th>39</tr>40</table>...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const root = document.querySelector('.storybook-root');2root.addEventListener('click', () => {3 console.log('storybook-root element is clicked');4});5const root = document.querySelector('.storybook-preview');6root.addEventListener('click', () => {7 console.log('storybook-preview element is clicked');8});9const root = document.querySelector('.storybook-preview-iframe');10root.addEventListener('click', () => {11 console.log('storybook-preview-iframe element is clicked');12});13const root = document.querySelector('.storybook-preview-wrapper');14root.addEventListener('click', () => {15 console.log('storybook-preview-wrapper element is clicked');16});17const root = document.querySelector('.storybook-preview-iframe');18root.addEventListener('click', () => {19 console.log('storybook-preview-iframe element is clicked');20});21const root = document.querySelector('.storybook-preview-background');22root.addEventListener('click', () => {23 console.log('storybook-preview-background element is clicked');24});25const root = document.querySelector('.storybook-preview-iframe');26root.addEventListener('click', () => {27 console.log('storybook-preview-iframe element is clicked');28});29const root = document.querySelector('.storybook-router');30root.addEventListener('click', () => {31 console.log('storybook-router element is clicked');32});33const root = document.querySelector('.storybook-router-iframe');34root.addEventListener('click', () => {35 console.log('storybook-router-iframe element is clicked');36});37const root = document.querySelector('.storybook-router-background');38root.addEventListener('click', () => {39 console.log('storybook-router-background element is clicked');40});41const root = document.querySelector('.storybook-router-iframe');42root.addEventListener('click', () => {43 console.log('storybook-router-iframe element is clicked');44});45const root = document.querySelector('.storybook-router');46root.addEventListener('click', () => {

Full Screen

Using AI Code Generation

copy

Full Screen

1import { configure } from '@storybook/react';2import { setOptions } from '@storybook/addon-options';3setOptions({4});5const req = require.context('../src', true, /\.stories\.js$/);6function loadStories() {7 req.keys().forEach(filename => req(filename));8}9configure(loadStories, module);10"scripts": {11},12const path = require('path');13module.exports = (baseConfig, env, defaultConfig) => {14 defaultConfig.module.rules.push({15 test: /\.(ts|tsx)$/,16 include: path.resolve(__dirname, '../'),17 loader: require.resolve('ts-loader')18 });19 defaultConfig.resolve.extensions.push('.ts', '.tsx');20 return defaultConfig;21};22import '@storybook/addon-actions/register';23import '@storybook/addon-actions/register';24import '@storybook/addon-knobs/register';25import '@storybook/addon-notes/register';26import '@storybook/addon-options/register';27import '@storybook/addon-viewport/register';28import '@storybook/addon-backgrounds/register';29import '@storybook/addon-links/register';30import '@storybook/addon-storysource/register';31import '@storybook/addon-viewport/register';32import '@storybook/addon-options/register';33import '@storybook/addon-notes/register';34import '@storybook/addon-knobs/register';35import '@storybook/addon-actions/register';

Full Screen

Using AI Code Generation

copy

Full Screen

1import { action } from '@storybook/addon-actions';2export default {3};4export const test = () => {5 const onClick = action('onClick');6 return (7 <div onClick={onClick}>8 );9};10test.story = {11};12import React from 'react';13import { storiesOf } from '@storybook/react';14import Test from './test';15storiesOf('Test', module).add('test', () => <Test />);16import React from 'react';17import { render } from '@testing-library/react';18import Test from './test';19describe('Test', () => {20 it('should render successfully', () => {21 const { baseElement } = render(<Test />);22 expect(baseElement).toBeTruthy();23 });24});25import React from 'react';26import { render } from '@testing-library/react';27import { withInfo } from '@storybook/addon-info';28import { withTests } from '@storybook/addon-jest';29import results from '../../../../../../../.jest-test-results.json';30import Test from './test';31const TestStory = () => <Test />;32storiesOf('Test', module)33 .addDecorator(34 withTests({35 })36 .addDecorator(37 withInfo({38 })39 .add('test', TestStory);40import React from 'react';41import { render } from '@testing-library/react';42import { withInfo } from '@storybook/addon-info';43import { withTests } from '@storybook/addon-jest';44import results from '../../../../../../../.jest-test-results.json';45import Test from './test';46const TestStory = () => <Test />;47storiesOf('Test', module)48 .addDecorator(49 withTests({50 })51 .addDecorator(52 withInfo({53 })54 .add('test', TestStory);55import React from 'react';56import { render } from '@testing-library/react';57import { withInfo } from '@storybook/addon-info';58import { withTests } from '@storybook/add

Full Screen

Using AI Code Generation

copy

Full Screen

1const button = document.querySelector("storybook-root");2button.onClick();3const button = document.querySelector("storybook-root");4button.onClick();5const button = document.querySelector("storybook-root");6button.onClick();7const button = document.querySelector("storybook-root");8button.onClick();9const button = document.querySelector("storybook-root");10button.onClick();11const button = document.querySelector("storybook-root");12button.onClick();13const button = document.querySelector("storybook-root");14button.onClick();15const button = document.querySelector("storybook-root");16button.onClick();17const button = document.querySelector("storybook-root");18button.onClick();19const button = document.querySelector("storybook-root");20button.onClick();21const button = document.querySelector("storybook-root");22button.onClick();23const button = document.querySelector("storybook-root");24button.onClick();25const button = document.querySelector("storybook-root");26button.onClick();27const button = document.querySelector("storybook-root");

Full Screen

Using AI Code Generation

copy

Full Screen

1const button = document.querySelector(".storybook-root button");2button.addEventListener("click", () => {3 console.log("clicked");4});5const button = document.createElement("button");6button.textContent = "Click Me";7button.addEventListener("click", () => {8 console.log("clicked");9});10document.querySelector(".storybook-root").appendChild(button);11const button = document.createElement("button");12button.textContent = "Click Me";13button.addEventListener("click", () => {14 console.log("clicked");15});16document.querySelector(".storybook-root").appendChild(button);17 document.getElementById("btn").addEventListener("click", () => {18 console.log("clicked");19 });20 document.getElementById("btn").addEventListener("click", () => {21 console.log("clicked");22 });23 document.getElementById("btn").addEventListener("click", () => {24 console.log("clicked");25 });26 document.getElementById("btn").addEventListener("click", () => {27 console.log("clicked");28 });29const button = document.createElement("button");30button.textContent = "Click Me";31button.addEventListener("click", () => {32 console.log("clicked");33});34document.querySelector(".storybook-root").appendChild(button);35const button = document.createElement("button");36button.textContent = "Click Me";37button.addEventListener("click", () => {38 console.log("clicked");39});40document.querySelector(".storybook-root").appendChild(button);

Full Screen

Using AI Code Generation

copy

Full Screen

1document.querySelector('.storybook-root').onclick = function() {2 alert('Storybook root was clicked!');3};4import '../test.js';5import { configure } from '@storybook/react';6function loadStories() {7 require('../stories/index.js');8}9configure(loadStories, module);

Full Screen

Using AI Code Generation

copy

Full Screen

1import React from 'react';2import { shallow } from 'enzyme';3import Button from './Button';4describe('Button component', () => {5 it('should render', () => {6 const wrapper = shallow(<Button />);7 expect(wrapper.exists()).toBe(true);8 });9 it('should call onClick method', () => {10 const wrapper = shallow(<Button />);11 wrapper.find('button').simulate('click');12 expect(wrapper.find('button').exists()).toBe(true);13 });14});15import React from 'react';16import { mount } from 'enzyme';17import Button from './Button';18describe('Button component', () => {19 it('should render', () => {20 const wrapper = mount(<Button />);21 expect(wrapper.exists()).toBe(true);22 });23 it('should call onClick method', () => {24 const wrapper = mount(<Button />);25 wrapper.find('button').simulate('click');26 expect(wrapper.find('button').exists()).toBe(true);27 });28});

Full Screen

Using AI Code Generation

copy

Full Screen

1document.getElementById("storybook-root").addEventListener("click", function(){2 document.getElementById("storybook-root").value = "Hello World!";3});4storiesOf("test", module)5 .add("test", () => {6 return (7 <div id="storybook-root" onClick={onClick} value="Hello World!">8 );9 });

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run storybook-root automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful