Posts

Showing posts with the label onclick

Duke Coursera Javascript : TO DO List

Image
This ( PDF ) is one of those that I think you should build completely from memory (Google/chatGPT fair game) every few weeks to stay sharp - if you're into web that is.. If you're only using the course to satisfy a pre-req for getting into software architecture, that's a different thing.. https://codepen.io/chipdesigner/pen/YzOGBGp I added the extra-credit feature and even went beyond, but I didn't think in terms of a software product. If you just add code, then how can you charge for an additional license for the new feature? 😊 Meaning, you need to add the feature in a smart, modular way. Ja? How do you change the onclick value of a button when you're passing an argument (if not passing, you just do whatever.onclick=nameoffunc; // no quotes or () Ans : whatever.onclick= function() { nameoffunc( arg );}; For submitting a text-field when ENTER is pressed :  Thanks :  https://stackoverflow.com/questions/16011312/how-can-i-execute-a-function-on-pressing-the-enter-key...

Why Doesn't this Work? Javascript getElementById onclick update..

Desired behavior : About button pressed : display text and change onclick to clear() (button text also changed) Clear (same button) pressed : go back to being ready for About to be pressed (onclick changed back to about() ) Using : <input id="aboutButton" type="button" onclick='doAbout()' value="About"> and function doAbout() {   document.getElementById("divabout").innerHTML = "by Ananth Chellappa<br>One Hour Design<br>Your questions answered within the hour";   document.getElementById("divabout").className="aboutcolor";   document.getElementById("aboutButton").onclick="clearAbout()";   document.getElementById("aboutButton").value="Clear"; } function clearAbout() {   document.getElementById("divabout").innerHTML = "";   document.getElementById("divabout").className="aboutcolor";   document.getElementById("ab...