I have the randomizer and child component emitting the updated headings working, but having a troubled time updating the parents and state to display the custom input title and subtitle on save and getting a "undefined" error for both title and subtitle when I placed console logs in updateTitleAndSubtitle() in the actions section of the store. When a user decides to edit, their input should then display on save those results on the parent component. I have a Vue app that can either randomize a title and subtitle OR manually edit these two values through a custom input component. Unrelated, but elfLastName2 is wrong, you can't get value from an index that is larger than length of the array (aka +2 is wrong) This however as you can see will print the same name 10 times, if you need generate 10 names and store them globally, than you'll need save them in the array instead. Var text = document.getElementById("textArea") this should print the name at least ten times but no i want this to get the result's from "generateName" and it should be a global value so i can use it in the next function Var elfFemNameGenerator = capFirst(elfFemName1) + " " + capFirst(elfLastName2) this function generates names using both "elfFemName" and "elfLastName" and the functions from above Return Math.floor(Math.random() * (max-min)) + min Return string.charAt(10).toUpperCase() + string.slice(1) this run the funtion that prints the namesĭocument.getElementById("elvenFemButton").onclick = namePrinter ĭocument.getElementById("elvenFemButton2").onclick = namePrinter2 However, if it's a element, then you need to use value property instead: So, in the loop use text.innerHTML += name InnerHTML is not a function, it's a property.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |