';
detailOptions.appendChild(refCard);
}
}
backBtn.addEventListener('click',function(){
detailView.style.display='none';
detailView.classList.remove('tutnav-detail-active');
gridView.style.display='';
});
// Filter
var filterClear=document.querySelector('#nav_tutorials .tutnav-filter-clear');
filterInput.addEventListener('input',function(){
var val=this.value.toLowerCase();
var cards=grid.querySelectorAll('.tutnav-card');
for(var i=0;i-1||label.indexOf(val)>-1)?'':'none';
}
});
if(filterClear){
filterClear.addEventListener('click',function(){
filterInput.value='';
var cards=grid.querySelectorAll('.tutnav-card');
for(var i=0;i'+t.label.toUpperCase()+' TUTORIAL';}
var titleArea=document.getElementById('tutnav_title_area');
var cardEl=grid.querySelector('.tutnav-card[data-name="'+t.name+'"]');
// Show the "MORE TUTORIALS" heading when displaying specific tutorial topics
var sectionHeading=document.querySelector('#nav_tutorials .tutnav-section-heading');
if(sectionHeading){sectionHeading.style.display='';sectionHeading.textContent='More Tutorials:';}
// Remove filter-only class when heading is shown
var tutHeader=document.querySelector('#nav_tutorials .tutnav-header');
if(tutHeader)tutHeader.classList.remove('filter-only');
var iconHtml=(cardEl?cardEl.querySelector('.tutnav-icon-wrap').innerHTML:'')||window.iconSvgs[t.name]||'';
titleArea.innerHTML='';
var ct=document.getElementById('tutnav_current_topic');
ct.style.display='';
var quizUrl=quizUrls[t.name]||'';
var html='
';
ct.innerHTML=html;
// Update active highlight
var allCards=grid.querySelectorAll('.tutnav-card');
for(var j=0;j'
+''
+''
+''
+'CERTIFICATE OF COMPLETION'
+'This certifies that'
+'Your Name'
+'has passed the W3Schools Certification exam and is hereby declared a'
+''+w3Svg+''
+'Certified Developer'
+'The candidate has passed the exam at the Professional level.'
+'Verify at'
+'verify.w3schools.com'
+'Stale Refsnes'
+'for w3schools.com'
+'';
var cardHtml='
'
+'
Become W3Schools Certified
'
+'
Get certified, and earn a credential that proves your skills.
'
+'
From $95
'
+'
Includes exam, course materials, exercises, and one year of the Hero plan.
';
if(currentTopic){currentTopic.style.display='';currentTopic.innerHTML=cardHtml;}
})();
// Show the tutorials heading and remove filter-only
var sectionHeading=document.querySelector('#nav_tutorials .tutnav-section-heading');
if(sectionHeading){sectionHeading.style.display='';sectionHeading.textContent='W3SCHOOLS TUTORIALS:';}
var tutHeader=document.querySelector('#nav_tutorials .tutnav-header');
if(tutHeader)tutHeader.classList.remove('filter-only');
}
})();
HTML Reference
Complete HTML tags reference
HTML Tags Reference
';
var sectionHeading=document.querySelector('.refnav-section-heading');
if(sectionHeading)sectionHeading.style.display='';
var refHeader=document.querySelector('.refnav-header');
if(refHeader)refHeader.classList.remove('filter-only');
container.innerHTML=cardHtml;
}else if(pathSeg1==='js'||pathSeg1==='javascript'){
if(mainHeading){mainHeading.style.display='';mainHeading.innerHTML='
';
var sectionHeading=document.querySelector('.refnav-section-heading');
if(sectionHeading)sectionHeading.style.display='';
var refHeader=document.querySelector('.refnav-header');
if(refHeader)refHeader.classList.remove('filter-only');
container.innerHTML=cardHtml;
}else{
if(mainHeading)mainHeading.style.display='none';
var w3Svg='';
var certUrl2='https://campus.w3schools.com/collections/course-catalog';
var previewSvg2='';
var cardHtml='
'
+'
Become W3Schools Certified
'
+'
Get certified, and earn a credential that proves your skills.
'
+'
From $95
'
+'
Includes exam, course materials, exercises, and one year of the Hero plan.
';
var sectionHeading=document.querySelector('.refnav-section-heading');
if(sectionHeading){sectionHeading.style.display='';sectionHeading.textContent='W3SCHOOLS REFERENCES:';}
var refHeader=document.querySelector('.refnav-header');
if(refHeader)refHeader.classList.remove('filter-only');
container.innerHTML=cardHtml;
}
}
var refCertSlugMap={html:'html-course',css:'css-course',javascript:'javascript-course',sql:'sql-course',python:'python-course',php:'php-course',java:'java-course',c:'learn-c','c++':'c++-course','c#':'c-course',bootstrap3:'bootstrap-3-certificate',bootstrap4:'bootstrap-4-certificate',react:'react-js-course',mysql:'mysql-course',jquery:'jquery-course',typescript:'typescript-course',nodejs:'nodejs-course',vue:'vue-js-course',django:'learn-django',numpy:'numpy-course',dsa:'dsa-course',excel:'learn-excel',xml:'xml-course',cybersecurity:'cyber-security-course',accessibility:'accessibility-course',git:'git-course',kotlin:'kotlin-course',mongodb:'mongodb-course',postgresql:'postgresql-course',r:'r-course',scipy:'scipy-course',angularjs:'angularjs-certificate',pandas:'pandas-course',w3css:'w3-css-certificate',angular:'angular-course',asp:'asp-certificate',sass:'sass-certificate',json:'json-certificate',svg:'svg-certificate',canvas:'canvas-certificate',bash:'bash-certification-exam'};
var refCertFullUrlMap={pandas:'https://campus.w3schools.com/collections/course-catalog/products/pandas-course',c:'https://campus.w3schools.com/collections/course-catalog/products/learn-c','c++':'https://campus.w3schools.com/collections/course-catalog/products/cpp-course','c#':'https://campus.w3schools.com/collections/course-catalog/products/c-course',react:'https://campus.w3schools.com/collections/course-catalog/products/react-js-course',mysql:'https://campus.w3schools.com/collections/course-catalog/products/learn-mysql-1',jquery:'https://campus.w3schools.com/collections/course-catalog/products/jquery-course',excel:'https://campus.w3schools.com/collections/course-catalog/products/learn-excel',xml:'https://campus.w3schools.com/collections/course-catalog/products/xml-course',django:'https://campus.w3schools.com/collections/course-catalog/products/learn-django',numpy:'https://campus.w3schools.com/collections/course-catalog/products/numpy-course',nodejs:'https://campus.w3schools.com/collections/course-catalog/products/learn-node-js',dsa:'https://campus.w3schools.com/collections/course-catalog/products/learn-data-structures-and-algorithms',typescript:'https://campus.w3schools.com/collections/course-catalog/products/learn-typescript',git:'https://campus.w3schools.com/collections/course-catalog/products/learn-git',postgresql:'https://campus.w3schools.com/collections/course-catalog/products/learn-postgresql',mongodb:'https://campus.w3schools.com/collections/course-catalog/products/learn-mongodb',kotlin:'https://campus.w3schools.com/collections/course-catalog/products/learn-kotlin',vue:'https://campus.w3schools.com/collections/course-catalog/products/learn-vue-js',scipy:'https://campus.w3schools.com/collections/course-catalog/products/learn-scipy',cybersecurity:'https://campus.w3schools.com/collections/course-catalog/products/cyber-security-course',accessibility:'https://campus.w3schools.com/collections/course-catalog/products/accessibility-course',bootstrap3:'https://campus.w3schools.com/collections/course-catalog/products/bootstrap-course'};
function showRefTopicCard(topicName){
var mainHeading=document.getElementById('refnav_main_heading');
var card=document.querySelector('#nav_references .refnav-card[data-name="'+topicName+'"]');
var label=card?card.querySelector('.refnav-card-title').textContent:topicName;
if(mainHeading){mainHeading.style.display='';mainHeading.innerHTML='
'+label.toUpperCase()+' REFERENCE
';}
var url=refUrlMap[topicName]||'';
var container=document.getElementById('refnav_quick_actions');
var iconEl=card?card.querySelector('.refnav-icon-wrap'):null;
var iconHtml='';
if(iconEl){var cloned=iconEl.cloneNode(true);var svg=cloned.querySelector('svg');if(svg){svg.removeAttribute('width');svg.removeAttribute('height');iconHtml=svg.outerHTML;}}
var cardHtml='
';
}
var certSlug=refCertSlugMap[topicName];
if(certSlug){
var certUrl=refCertFullUrlMap[topicName]||'https://campus.w3schools.com/collections/certifications/products/'+certSlug;
var certIconSvg=(window.iconSvgs&&window.iconSvgs[topicName])||iconHtml;
var certIconSvg48=certIconSvg?certIconSvg.replace(/width="[^"]*"/,'width="48"').replace(/height="[^"]*"/,'height="48"'):'';
var certPreview='';
cardHtml+='
';
cardHtml+='
';
cardHtml+='
Become '+label+' Certified
';
cardHtml+='
Get certified with our '+label+' exam, includes a professional study kit to guide you from beginner to exam-ready.
';
container.innerHTML=cardHtml;
var prev=document.querySelector('#nav_references .refnav-card-active');
if(prev)prev.classList.remove('refnav-card-active');
if(card)card.classList.add('refnav-card-active');
var scrollEl=document.querySelector('#nav_references .refnav-topics-scroll');
if(scrollEl)scrollEl.scrollTop=0;
}
// Clone icons from Exercises cards (lazy � runs on first open)
var iconsCloned=false;
function cloneExerciseIcons(){
if(iconsCloned)return;
var refCards=document.querySelectorAll('#nav_references .refnav-card');
var anyCloned=false;
for(var i=0;i
';
// Show the "SELECT ANOTHER TOPIC:" heading when displaying specific exercise topics
var sectionHeading=document.querySelector('#nav_exercises .exnav-section-heading');
if(sectionHeading)sectionHeading.style.display='';
// Remove filter-only class when heading is shown
var exHeader=document.querySelector('#nav_exercises .exnav-header');
if(exHeader)exHeader.classList.remove('filter-only');
var qaHtml='
';
qaContainer.innerHTML=qaHtml;
var qaTip=document.getElementById('exnav_quick_tip');
if(qaTip)qaTip.style.display='flex';
if(currentHighlight)currentHighlight.style.background='';
var prevActive=document.querySelector('#nav_exercises .exnav-card-active');if(prevActive)prevActive.classList.remove('exnav-card-active');
if(qaCard){qaCard.classList.add('exnav-card-active');currentHighlight=qaCard;}
var scrollEl=document.querySelector('#nav_exercises .exnav-topics-scroll');
if(scrollEl)scrollEl.scrollTop=0;
var listEl=document.getElementById('exercises_list');
if(listEl)listEl.scrollTop=0;
}
if(activeTopic){
showTopicQuickActions(activeTopic);
}else{
// Show default exercises heading for folders not in exercise list
var mainHeading=document.getElementById('exnav_main_heading');
var quickActions=document.getElementById('exnav_quick_actions');
var sectionHeading=document.querySelector('#nav_exercises .exnav-section-heading');
if(mainHeading)mainHeading.innerHTML='
W3SCHOOLS EXERCISES
';
if(sectionHeading){sectionHeading.style.display='';sectionHeading.textContent='Select a topic:';}
var exHeader=document.querySelector('#nav_exercises .exnav-header');
if(exHeader)exHeader.classList.remove('filter-only');
// Build multi-icon SVG: 2x2 grid of small topic icons
var pyIcon=(window.iconSvgs['python']||'').replace(/id="tut-py-b"/g,'id="def-py-b"').replace(/id="tut-py-y"/g,'id="def-py-y"').replace(/url\(#tut-py-b\)/g,'url(#def-py-b)').replace(/url\(#tut-py-y\)/g,'url(#def-py-y)');var multiIcon='
'+window.iconSvgs['react']+'
'+pyIcon+'
'+window.iconSvgs['html']+'
'+window.iconSvgs['css']+'
'+window.iconSvgs['java']+'
';
var defaultCards=[
{title:'Exercises',desc:'Practice with interactive exercises',url:'/exercises/index.php',icon:multiIcon,btnText:'Browse Exercises',subtitle:'What is an Exercise?',subtitleUrl:'/exercises/index.php'},
{title:'Quizzes',desc:'Test your knowledge',url:'/quiztest/default.asp',icon:qaIcons.quiz,btnText:'Browse Quizzes',subtitle:'What is a Quiz?',subtitleUrl:'/quiztest/default.asp'},
{title:'Challenges',desc:'Solve coding challenges',url:'/challenges/index.php',icon:qaIcons.challenges,btnText:'Browse Challenges',subtitle:'What is a Challenge?',subtitleUrl:'/challenges/index.php'},
{title:'Practice Problems',desc:'Solve real-life coding problems',url:'/practice/index.php',icon:qaIcons.problems,btnText:'Browse Problems',subtitle:'What is a Practice Problem?',subtitleUrl:'/practice/index.php'}
];
var defHtml='
';
if(quickActions)quickActions.innerHTML=defHtml;
}
var nav=document.getElementById('nav_exercises');
nav.addEventListener('click',function(e){
var card=e.target.closest('.exnav-card');
if(!card)return;
var name=card.getAttribute('data-name');
if(!name)return;
var urls=urlMap[name];
if(urls&&urls.exercises){window.location.href=urls.exercises;}
});
// Populate exercises card icons from shared iconSvgs library
var exCards=document.querySelectorAll('#nav_exercises .exnav-card');
exCards.forEach(function(card){
var topicName=card.getAttribute('data-name');
var iconWrap=card.querySelector('.exnav-icon-wrap');
if(iconWrap&&window.iconSvgs&&window.iconSvgs[topicName]){
var svgHtml=window.iconSvgs[topicName];
if(topicName==='python'){svgHtml=svgHtml.replace(/id="tut-py-b"/g,'id="ex-py-b"').replace(/id="tut-py-y"/g,'id="ex-py-y"').replace(/url\(#tut-py-b\)/g,'url(#ex-py-b)').replace(/url\(#tut-py-y\)/g,'url(#ex-py-y)');}
iconWrap.innerHTML=svgHtml;
}
});
})();
Information can be passed into functions as arguments.
Arguments are specified after the function name, inside the parentheses.
You can add as many arguments as you want, just separate them with a comma.
The following example has a function with one argument (fname).
When the function is called, we pass along a first name,
which is used inside the function to print the full name:
Arguments are often shortened to args in Python documentations.
Parameters or Arguments?
The terms parameter and argument can be used for the same thing: information that are passed into a function.
From a function's perspective:
A parameter is the variable listed inside the parentheses in the function definition.
An argument is the value that are sent to the function when it is called.
Number of Arguments
By default, a function must be called with the correct number of arguments.
Meaning that if your function expects 2 arguments, you have to call the function
with 2 arguments, not more, and not less.
Example
This function expects 2 arguments, and gets 2 arguments: