javascript

What is the difference between document.location.href and document.location?

孤人 提交于 2020-01-19 03:08:49
问题 What is the difference between document.location.href and document.location ? Is it the same across browsers? 回答1: document.location is a synonym for window.location that has been deprecated for almost as long as JavaScript has existed. Don't use it. location is a structured object, with

minimise the code since I am using the same code only the content in p tags changes and component AccordionHeader header changes

房东的猫 提交于 2020-01-19 01:50:12
问题 I am new to js. i need to display 6 sliders. each div when I click should open its corresponding content. when i click the div again the content should be closed. just like an accordion. right know it works but how to minimise the code since I am using the same code only the content in p tags