Jump to content


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

8,723 profile views

smus's Achievements


Member (2/7)



  1. I am not familiar with classes, so I need a solution, or, at least, a clue, please! This code causes the error: TypeError: Cannot read property 'vendor' of undefined When I am trying to check its correctness, the interpreter also informs that the context is not bound to the 'getInfo' method. How can we correct classes in order to avoid the error? class Transport { constructor(type, price, vendor, model) { this.type = type; this.price = price; this.vendor = vendor; this.model = model; } getInfo() { return `${this.vendor}, ${this.model}`; } getPrice() { return this.price + '$'; } } class Car extends Transport { constructor(vendor, model, doorsCount, price) { super('car', price, vendor, model); this.doorsCount = doorsCount; } getDoorsCount() { return `Number of doors: ${this.doorsCount}`; } } class Bike extends Transport { constructor(vendor, model, maxSpeed, price) { super('bike', price, vendor, model); this.maxSpeed = maxSpeed; } getMaxSpeed() { return `Max speed: ${this.maxSpeed} kmh`; } }
  2. Got it: ul:nth-child(2) li:nth-child(even){ background-color: #996666; } 2 is because there is another <div></div> tag before all the <ul>s. So, in this case, first <ul> is the second child of the <body>
  3. You just need to deactivate what is written for :hover in CSS file. Try looking for it inside your style.css file for your active WP theme. It should be in the WP theme folder
  4. <ul class="cards"> <li class="two heart"></li> <li class="five diamond"></li> <li class="ten heart"></li> <li class="jack club"></li> <li class="queen spade"></li> <li class="king diamond"></li> <li class="ace heart"></li> <li class="six heart"></li> <li class="seven diamond"></li> <li class="eight spade"></li> <li class="nine club"></li> <li class="three club"></li> <li class="four heart"></li> </ul> <ul class="cards"> <li class="five spade"></li> <li class="six diamond"></li> <li class="seven spade"></li> <li class="eight club"></li> <li class="two diamond"></li> <li class="three heart"></li> <li class="four club"></li> <li class="queen club"></li> <li class="king spade"></li> <li class="seven diamond"></li> <li class="nine heart"></li> <li class="ten diamond"></li> <li class="jack heart"></li> </ul> <ul class="cards"> <li class="two spade"></li> <li class="ten heart"></li> <li class="ace club"></li> <li class="five heart"></li> <li class="nine diamond"></li> <li class="king diamond"></li> <li class="ace spade"></li> <li class="six heart"></li> <li class="eight diamond"></li> <li class="ace spade"></li> <li class="queen heart"></li> <li class="three diamond"></li> <li class="four spade"></li> </ul> <ul class="cards"> <li class="king heart"></li> <li class="jack club"></li> <li class="two club"></li> <li class="three spade"></li> <li class="four diamond"></li> <li class="ten club"></li> <li class="jack spade"></li> <li class="eight diamond"></li> <li class="nine spade"></li> <li class="queen diamond"></li> <li class="five club"></li> <li class="six club"></li> <li class="seven heart"></li> </ul> How can we call to all even <li> inside the first <ul>? I tried something like: li:nth-child(even) ul.cards:first-child{ background-color: #996666; }
  5. Since there is no 'NodeJS/MongoDB' discussion section I decided to post my question to 'JavaScript'. I am trying to start the server by running mongod.exe, and by doing the same thing using cmd. I want to start the server and use it with a tool called Robo 3T to manipulate NoSQL databases. There is no active connection can be seen in Robo 3T after I start mongo. Can anyone explain what I am supposed to do? What is the correct way to run MongoDB on Windows?
  6. document.getElementById("demo").innerHTML = days + "d " + hours + "h " + minutes + "m <span style='color:red'>" + seconds + "</span>s "
  7. Have you tried an <object> tag as a container for your page?
  8. Yes, you can, by using pure CSS (not necessarilly with W3.css). Try something like this: <style> .label:after{ content:'text I want to change'; } .label:hover:after{ content:'changed text'; } </style> <body> <p>text <span class="label"></span> text</p> </body>
  9. The page already goes with <style>section{display:none}</style> written in it. Adding and removing classes won't influence it. I also tried section.style.display='unset' which provides the same result as 'initial', and section.style.display=' ', but it does not work at all. As it is discussed here: https://stackoverflow.com/questions/18534561/what-is-use-of-initial-value-in-css 'initial' only resets to a CSS default, not to a browser default. And they only plan to add something in CSS4. While we are waiting the only reasonable way I thought about is to check each element if it is actual initial style property is 'block' or not, before switching it back from 'display:none'. Something like: if(element.tagName == 'div'){element.style.display = 'block'}... ☺️
  10. Very helpful, thanks! display = "initial" works, however, it changes the style not to display = "block" (which is default one for <section> tag), but to display = "inline". I wonder what the result would be if we do the following: <style> section{display:none} </style> <script> document.getElementsByTagName('section')[0].style.display = 'block' document.getElementsByTagName('section')[0].style.display = 'initial' </script> will it switch back to display = 'inline'? If so, why?
  11. For example, an element's default value is 'inline'. It was as 'display:block' on my page, but now it is hidden by 'display:none'. I want it back to visible again, but to its default state. I tried element.style.display = "", element.style.display = "auto", as well as element.style.removeProperty = "display", as it is described here: https://stackoverflow.com/questions/21457904/change-element-display-none-back-to-default-style-value-js But it could not be changed from 'display:none' (only by using 'display:block') There is an official list of default style properties, like, for example, this one: https://www.w3schools.com/cssref/css_default_values.asp but is there a way to get it by JavaScript?
  12. Server settings, try absolute address
  13. For the default value, you should simply add value="yourdefaultvalue" to your input tag. What do you want to display "LHS,RHS" in your code, when datalist is set to "initial or awlays"?
  14. var pageBreak = document.getElementById("pageBreak") All var declarations must be inside the function
  15. vmars316, not working at all or with errors? Looks like collectedTextareas variable was not initialized
  • Create New...