Created
June 13, 2018 11:15
-
-
Save CB9TOIIIA/971fea1870a03ff5352d86b8a53ac45c to your computer and use it in GitHub Desktop.
Форма и select
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> | |
jQuery(document).ready(function($) { | |
options = $("select[name=class-of-car]>option:first"); | |
option = options.text(); | |
var regex = /\d+.BYN/; | |
cenaselecta = regex.exec(option); | |
// alert(cenaselect); | |
$("#resultcena").text(cenaselecta); | |
jQuery('select[name=class-of-car]').change(function() { | |
var text = $("select[name=class-of-car] option:selected")[0]; | |
var valprice = text.value; | |
// alert(valprice); | |
var regex = /\d+.BYN/; | |
cenaselect = regex.exec(valprice); | |
// alert(cenaselect); | |
$("#resultcena").text(cenaselect); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment