Last active
December 12, 2017 12:39
-
-
Save pastyrMisha/74c2bb5473854fe74758fc12086dee1f to your computer and use it in GitHub Desktop.
определение пола
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | |
<form name="form" id="form"> | |
<label for="female">Женский</label> | |
<input type="radio" id="female" name="sex" value="female" /> | |
<label for="male">Мужской</label> | |
<input type="radio" id="male" name="sex" value="male" /> | |
<br /><br /> | |
<span id="message"></span> | |
<input type="button" id="done" onclick="return valid()" value="Готово" /> | |
</form> | |
<img src="1.jpg" style="display: none" id="img" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function valid() { | |
var state = $("input[name= 'sex']:checked").val(); | |
$("#message").show(); | |
if(!state) return $("#message").html("<font style='color:red'>Укажите Ваш пол!</font><br />"); | |
$("#message").hide(); | |
if(state == "male") | |
$("#img").show(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Andrey-web Ahahahahah))