I have seen this question and I have seen this fiddle.
. It's a simple question. Why doesn't it work?
<input checked="checked" id="article_format_html" name="article[format]" type="radio" value="html">Some meaningful value
<input id="article_format_text" name="article[format]" type="radio" value="text">Another Value
On popular demand I did this:
Result: Doesn't work.
Edit 2: (Why I had the problem)
So, JS-Fiddle wraps your js code in the head of the
that is your
section. For jQuery selectors (or any js that manipulates the DOM) to work properly, it has to be executed *after*
the DOM element has been rendered. Hence, wrapping your code on ready and/or just before
closes, is the safest way to ensure that your query selectors don't return