Skip to content

Instantly share code, notes, and snippets.

@jeremy5189
Created April 7, 2017 07:42
Show Gist options
  • Save jeremy5189/98a51b6c92f129f36381747ccfd2039b to your computer and use it in GitHub Desktop.
Save jeremy5189/98a51b6c92f129f36381747ccfd2039b to your computer and use it in GitHub Desktop.
javascript:(function()%7Bfunction callback()%7B(function(%24)%7Bvar jQuery%3D%24%3Bvar questions %3D %5B%5D%2Coptions %3D %5B%5D%2Ccount %3D 0%3B%24('%5Btype%3D"radio"%5D').each( function() %7Boptions.push(%24(this).attr('id'))%3Bcount%2B%2B%3Bif( count %25 5 %3D%3D 0 ) %7Bquestions.push(options)%3Boptions %3D %5B%5D%7D%7D)%3Bfor( key in questions ) %7Bvar rnd %3D Math.floor((Math.random() * 3) %2B 1)-1%3B%24('%23' %2B questions%5Bkey%5D%5Brnd%5D).attr('checked'%2C 'checked')%3B%7D%7D)(jQuery.noConflict(true))%7Dvar s%3Ddocument.createElement("script")%3Bs.src%3D"https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.7.1%2Fjquery.min.js"%3Bif(s.addEventListener)%7Bs.addEventListener("load"%2Ccallback%2Cfalse)%7Delse if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment