×
×
Correct!
Refs are used to refer to specific DOM elements. Supply the missing code so that 'Hello World' is displayed in the second <p> tag when the application is mounted.
<template>
<p>This is just some text.</p>
<p @(9)>This is the initial text</p>
</template>
<script>
export default {
mounted() {
this.@(5).pEl.innerHTML = "Hello World!";
}
};
</script>
<template>
<p>This is just some text.</p>
<p ref="pEl">This is the initial text</p>
</template>
<script>
export default {
mounted() {
this.$refs.pEl.innerHTML = "Hello World!";
}
};
</script>
<template>
<p>This is just some text.</p>
<p ref='pEl'>This is the initial text</p>
</template>
<script>
export default {
mounted() {
this.$refs.pEl.innerHTML = "Hello World!";
}
};
</script>
Not CorrectClick here to try again. Correct! |
This will reset the score of ALL 54 exercises.
Are you sure you want to continue?