Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Architect

Members
  • Joined

  • Last visited

Everything posted by Architect

  1. Hello, I have just begun learning JS at W3 Schools. At the Introduction(https://www.w3schools.com/js/js_intro.asp), it is stated that JS is insensitive to the use of either single- or double quotes. The Introduction states these two lines are the same: document.getElementById("demo").innerHTML = "Hello JavaScript"; And: document.getElementById('demo').innerHTML = 'Hello JavaScript'; The first uses double quotes and the second singe quotes. However, the exercise for changing the src of an image reveals a quote-sensitivity: <button onclick="document.getElementById('myImage').src='https://www.w3schools.com/js/pic_bulbon.gif' ">On</button> <img id="myImage" src="https://www.w3schools.com/js/pic_bulboff.gif" /> <button onclick="document.getElementById('myImage').src='https://www.w3schools.com/js/pic_bulboff.gif' ">Off</button> Here, getElementById('myImage') uses single quotes. This functions properly when ran; please see JSfiddle for example: https://jsfiddle.net/d6kac84f/ However, in the following code I use double quotes to enclose myImage, yielding an apparent syntax error: <!DOCTYPE html> <html> <body> <button onclick="document.getElementById("myImage").src='https://www.w3schools.com/js/pic_bulbon.gif' ">On</button> <img id="myImage" src="https://www.w3schools.com/js/pic_bulboff.gif" /> <button onclick="document.getElementById("myImage").src='https://www.w3schools.com/js/pic_bulboff.gif' ">Off</button> </body> </html> See JSfiddle: https://jsfiddle.net/x42o7sgp/ The JSfiddle console states the following (as a neophyte to me yet unintelligible): This is strange, because the above two codes use singe- and double quotes without yielding a syntax error: document.getElementById("demo").innerHTML = "Hello JavaScript"; document.getElementById('demo').innerHTML = 'Hello JavaScript'; It is as if the sensitivity suddenly lies within the parenthesis: <button onclick="document.getElementById('myImage').src='https://www.w3schools.com/js/pic_bulbon.gif' ">On</button> (This one works) <button onclick="document.getElementById("myImage").src='https://www.w3schools.com/js/pic_bulbon.gif' ">On</button> (This one doesn't work) Thank you, should you be willing to point me in the right direction. Architect
  2. Hello everyone, At 2:44:10 of Dave Gray's excellent CSS tutorial for beginners, the intention is to make a hover effect have the same rounded corners as its container, so that they visually match. My code seems identical to his, but I cannot attain the same effect. Here is my page (JSFiddle). The li:last-child a{border-radius: 0 0 2rem 2rem;} doesn't work yet does not seem erroneous. It is intended to make the last li a:hover assume the same shape as the rounded bottom corners of the nav element, in which the list anchors are nested. Can anyone point out to me where my code is not identical to his? I apologize; I really cannot see it. Kindly, Architect P.S. The forum doesn't allow me to form a link to the YouTube video; I'll try to copy/pate it here directly rather than hyperlink a relevant piece of text in my message above: P.P.S. Forum doesn't accept my link to JSFiddle either, so I'll try to copy/paste the link here rather than hyperlink the relevant text above: https://jsfiddle.net/Architect0/28psknzc/7/

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.