FSD_Assignment_2_Answers
FSD_Assignment_2_Answers
3. Explain the two steps for accessing and updating attribute nodes with
example.
Two steps are:
1. Select the element node.
Example: var img = document.getElementById("logo");
2. Use methods/properties:
- getAttribute("src"): img.getAttribute("src");
- setAttribute("alt", "New Logo"): img.setAttribute("alt", "New Logo");
- removeAttribute("title"): img.removeAttribute("title");
- hasAttribute("src"): img.hasAttribute("src");
Example:
Frontend sends form data to Express, Express saves it in MongoDB, React shows it in the UI.
Example:
class Welcome extends React.Component {
render() { return <h1>Hello, {this.props.name}</h1>; }
}
Example:
New issue - Title: 'Login Bug', Status: 'Open', Owner: 'Dev1'
Example:
function Greet(props) { return <h1>Hello, {props.name}</h1>; }
Example:
const observer = new MutationObserver((mutations) => { console.log(mutations); });
observer.observe(document.body, { childList: true, subtree: true });