RickRieger
RickRieger

Reputation: 3

Why does VS Studio Code insert code I do not want when typing?

I'm puzzled as to why the suggested code that pops up with in vs studio takes over when I'm typing the following code;

x[i].style.color = 'red';

it takes over just after 'style' is typed and I hit the period button. Quite annoying.

Below is the block of code I'm running:

function myFunction() {
  let x, i;
  x = document.querySelectorAll('.para');
  for (i = 0; i < x.length; i++) {
    x[i].style.color = 'red';
  }
}

This is what happens in the editor, it wants to insert 'getElementsByClassName':

function myFunction() {
  let x, i;
  x = document.querySelectorAll('.para');
  for (i = 0; i < x.length; i++) {
    x[i].getElementsByClassName.
  }
}

Upvotes: 0

Views: 101

Answers (0)

Related Questions