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.

Cookies question

Featured Replies

Hi everybody first and foremost i think that this is a fantastic forum and i have learned a lot here thank you everybody.

 

OK i need a little bit of help on a project im working on. It involves cookies so basically i have a website that is nearly done. I want to add a feature where when the user clicks on a button it will change the layout style. I have figured that part out and it works perfectly but i havent figured out how if when the user clicks on it every page should have the new style. I know there are several alternatives like server side but i want to use a cookie for it but i dont know how to do that. Could someone please help me

 

This is the javascript that is being used.

function back2()
{

var elem = document.getElementById("foot");
elem.style.backgroundColor = "grey";

var elem = document.getElementById("ab");
elem.style.backgroundColor = "grey";

var elem = document.getElementById("aa");
elem.style.backgroundColor = "#E1E1E2";

}

 

 

This is how the HTML looks like

<button type="button" onclick="back2()">comfortable </button>

 

 

 

  • Author

Thats looks nice but i dont want to use JQuery i just want to use a cookie to do that but how to do ?

  • 3 weeks later...
  • 2 weeks later...

Create an account or sign in to comment

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.