Skip to content

Instantly share code, notes, and snippets.

@pastyrMisha
Last active December 12, 2017 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pastyrMisha/74c2bb5473854fe74758fc12086dee1f to your computer and use it in GitHub Desktop.
Save pastyrMisha/74c2bb5473854fe74758fc12086dee1f to your computer and use it in GitHub Desktop.
определение пола
<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" />
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();
}
@Andrey-web
Copy link

Andrey-web commented Dec 12, 2017

I know this script...
(c)Pithecanthropus

@pastyrMisha
Copy link
Author

@Andrey-web Ahahahahah))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment