Test:
test.html
Code:
js/Menu.js Code: Copy code The code is as follows: //This is using the custom method hideElement() and shwoElement() Test results: function isChang(values) { if(values=="yxsh"){ hideElement("key"); showElement("yxsh"); }else{ hideElement("yxsh"); showElement("key"); } } //Custom method hideElement() function hideElement( id){ document.getElementById(id).style.display="none"; } //Custom method showElement() function showElement(id){ document. getElementById(id).style.display=""; } //This is to directly set whether to hide or not without a custom function function isChang1(values) { if(values= ="yxsh"){ document.getElementById("yxsh").style.display=""; document.getElementById("key").style.display="none"; }else { document.getElementById("yxsh").style.display="none"; document.getElementById("key").style.display=""; } } The default selection is: by department This is if we choose: not by department, that is, by: employee number or name, then, It will be hidden at this time: and. .. If we choose: by department, that is, by default Then the result is: .. . and
Related labels:
source:php.cn
Previous article:JavaScript anonymous function and closure_javascript skills
Next article:Code to control font size through JavaScript_javascript tips
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Latest Issues
Extract text from multiple span elements without classes - using BeautifulSoup
From 1970-01-01 08:00:00
0
0
0
angular.js - angularjs realizes double-clicking the span tag and turning the span tag into an input tag?
From 1970-01-01 08:00:00
0
0
0
angular.js - How to get the content in the span tag after clicking a span tag in angularjs?
From 1970-01-01 08:00:00
0
0
0
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|