-
Notifications
You must be signed in to change notification settings - Fork 0
JQuery
Johnson Fu edited this page Oct 22, 2019
·
3 revisions
Load JQuery
<script src="https://unpkg.com/jquery@1.12.4"></script>
Start JQuery Code
1st Execute when the document is ready
$(function(){
// Document is ready
});
2nd…
$(document).ready(function(){
$(".btn1").click(function(){
$("p").slideToggle();
});
});
get self defined attributes
alert(JSON.stringify(product_data));
var min_age = $('#applicant_product_code option:selected').attr('min-age');
var max_age = $('#applicant_product_code option:selected').attr('max-age');
parse int
min_age = parseInt(min_age);
max_age = parseInt(max_age);
check properties, such as checked
$('#date_of_birth').prop("checked", false);
$('#age_of_applicant').prop("checked", false);
change css block
$('#date_of_birth').prop("checked", true);
$("#ageRangeMessage").css('display', 'none')
add/remove attribute and add/remove class
$("#day").attr('disabled','disabled');
$("#day").removeAttr("disabled");
$('.init_age_box1').addClass('block_opacity is-filled');
$('.init_age_box2').removeClass('block_opacity is-filled');
- freemarker
- thymeleaf
- JMX (jconsole)
- ZeroMQ
- microk8s
- multipass
- pwsh (powershell)