JSFiddle - React, Tailwind, and code Playground
by Dede Brolosse
HTML
<script src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css">
<div data-role="page" id="apply" data-theme="a">
<div data-role="header">
<h1>Test</h1>
</div>
<!-- /header -->
<form id="form" name="form" action="" method="post">
<div data-role="content">
<div class="form-background ui-corner-tl ui-corner-tr ui-corner-bl ui-corner-br">
<h2 class="section">
Radio Test
</h2>
<div data-role="content">
<div id="second_radio_div" name="second_radio_div">
<div data-role="fieldcontain">
<fieldset data-role="controlgroup" data-type="horizontal">
<div>Radio</div>
<input type="radio" name="second_radio" id="second_radio_yes" value="yes" />
<label for="second_radio_yes">Yes</label>
<input type="radio" name="second_radio" id="second_radio_no" value="no" checked="checked" />
<label for="second_radio_no">No</label>
</fieldset>
</div>
</div>
<div id="third_element_div" name="third_element_div">
<div data-role="fieldcontain">
<input type="text" name="third_element" id="third_element" class="default-value" />
</div>
</div>
</div>
<!-- /content -->
</div>
<!-- /content -->
<fieldset data-role="controlgroup" id="field_radio_amis">
<legend></legend>
<label for="cat">Cat</label>
<input type="radio"...
JavaScript
$(document).ready(function () {
// détection de la saisie dans le champ de recherche
$("#btn_test").click(function () {
$('#third_element').val('it\'s Ok to set an input by a click')
$('input:radio[name="radio_animal"]').filter('[value="amis"]').prop('checked', true);
});
});