> For the complete documentation index, see [llms.txt](https://rpeltz.gitbook.io/introduction-to-web-development/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rpeltz.gitbook.io/introduction-to-web-development/week-3-javascript-and-html-forms/project-dynamic-style-change.md).

# Project: Dynamic Style Change

In this project, we'll let the user specify the background color, font color, and font family by collecting data from a form.

The HTML and CSS for this project have already been written.  To complete the project, you will write the code that handles the Update button click.

* Locate the code for this project in GitHub:

<https://github.com/rebeccapeltz/js-event-handling/blob/main/update-style/index.html>

* Look at the rendered page in GithHub:&#x20;

[https://www.beckypeltz.me/js-event-handling/update-style](https://www.beckypeltz.me/js-event-handling/update-style/)

* Create a Replit project and import the GitHub project <https://github.com/rebeccapeltz/js-event-handling/tree/main> into the Replit project.
* Add a JavaScript event handler to the update-style script.js file. The event handler is triggered by clicking on the Update Button.
* Use query selectors to get the data entered by the User.
* If the User didn't choose a Select element, the result will be an empty string `""`. Test for the empty string, and if it is false, set the style requested by the user. &#x20;
* Process the Radio button elements using querySelectorAll and the forEach method to find the checked button and then apply the user's font family style choice.  If none of the buttons are checked, don't make any changes.
* (optional) If the user doesn't select any changes on the form, you can use the `alert` function to let them know that nothing will be changed.

<figure><img src="/files/qW01CoFJFUA3NrO9rCGR" alt=""><figcaption><p>Process the User Input for Page Style</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://rpeltz.gitbook.io/introduction-to-web-development/week-3-javascript-and-html-forms/project-dynamic-style-change.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
