// Add the class name active, iterate through the sibling element, delete the active in the sibling element
$(this).addClass('active').siblings().removeClass('active');


// Get the name of the child element of the element whose parent element is name
$(this).parents('.name').find('.price')


// Append the HTML code to the parent element box
$(this).parents('.box').append(html)


//JQ gets the custom data attribute
$(this).data('id')


//input gets focus
$("input").focus();
$("input").focus(function() {});
$("input").blur();
$("input").blur(function() {})


// Delete the specified string
//replace(' string for argument 1 to delete ',' if argument 2 is empty, delete only ')
var money2 = $('#order_price').text().replace('元'.' ') // Amount to be paid


// String to number
parseFloat(money1) / / decimal
parseInt(money1) / / integer


// The DOM element hides the display judgment
if (document.getElementById("div").css("display") = = ='none') {}
if (document.getElementById("div").css("display") = = ='block') {}
setTimeout(function() {
    console.log(_this.parents('.name').find('.city-picker-dropdown').is(':visible'))
    if (_this.parents('.name').find('.city-picker-dropdown').is(':visible') = =false) {
        console.log('hide')}else {
        console.log('show')}},100)


// Keyboard event, press the key value code
$("#inputval").bind('keydown'.'down'.function (event){
    console.log(event.keyCode)
})


// Return to the top left corner of the browser to refresh the page
if(window.performance.navigation.type == 2) {console.log('return')
    window.location.replace(window.location.href);
}
Copy the code