Tell us what’s happening:
its asking me to assign the string “The” to this innerText property.
and what does that means??
i got stucked here…someone please help…
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
function attack() {
text.innerText = "The <monster name> attacks.";
}
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0
Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 120
Hi there!
You need to use concatenation before and after the <monster name>
.
Example
"Text " + element name + " more text ."
Use actual text and required element with name property using dot and bracket notation.
element[index].name
Tell us what’s happening:
Just tell me how to handle this .
please give me an idea…help me guys
Your code so far
<!-- file: index.html -->
/* file: script.js */
// User Editable Region
function attack() {
text.innerText = "The" + <monster name> + "attacks.";
}
// User Editable Region
/* file: styles.css */
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0
Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 120
hi there!
the instructions is asking you: Now you can build the attack
function. First, update the text
message to say "The <monster name> attacks."
, replacing <monster name>
with the name of the monster. Remember you can use the concatenation operator for this.
give a space between the word "The"
and second quote mark. also give aspace between th word "attcks."
and its first quote mark. and use the monsters
array indexing fighting
with .name
propety as <monster name>
.
Edit: for getting monster name
, check line number 158
in the challenge editor.
1 Like
Tell us what’s happening:
Hey please someone help me properly…
till now this the 3rd time, i’m posting this topic for help…
but no one is helping me properly…
Just tell me what is missing and what is more needed.
Your code so far
<!-- file: index.html -->
/* file: script.js */
// User Editable Region
function attack() {
text = "The <monster name> attacks."
innetText = "The " + monsters[fighting].name + " attacks.";
}
// User Editable Region
/* file: styles.css */
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0
Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 120
please be informed that posting duplicate topics here is not allowed. I have merged your duplicates into one.
If you need more help in the same step, just add a reply asking your follow-up questions rather than opening a new topic.
you are being asked to update the text
message.
So the first thing you have to do is identify is what do they mean by text
message.
The word text is highlighted for you to indicate that it has a special meaning in the exercise.
So step 1, find the text
they are talking about. (look at how it is defined)
Then step 2, try to figure out what it means to update the message for this variable.
This will change depending on what type of thing text
variable is defined as.
If you don’t remember how to do something, you can always just look it up by googling or by reading the older code for this project to see how the message in the variable text was updated before. (then do the same thing here)
Once you’ve identified the variable you’re changing and how to change it, the next step is understanding this instruction:
update the text message to say “The <monster name>
attacks.”, replacing <monster name>
with the name of the monster.
They want you to replace the words in the angled brackets with the name of the monster.
So you may think about: what is the name of the monster?
And how do I put it in the middle of the sentence?
Again, looking at code you have written before in this project should help.
Try to work in small steps and that way you will make progress.
1 Like