Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS 取消默认事件 #5

Open
meahu opened this issue Apr 27, 2019 · 0 comments
Open

JS 取消默认事件 #5

meahu opened this issue Apr 27, 2019 · 0 comments

Comments

@meahu
Copy link
Owner

meahu commented Apr 27, 2019

阻止浏览器的默认行为

function preventDefault( e ) { 
    if ( e && e.preventDefault ) 
        e.preventDefault(); 
    else { // IE中阻止函数器默认动作的方式 
        window.event.returnValue = false;
    }   
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant