Creating an id

How do you create an id for an element?

I successfully created a paragraph with:

var newLink = document.createElement(‘p’); //create paragraph

and tried (unsuccessfully) to create an id with:

newlink.setAttribute(‘id’, ‘noSug’);

What’s the right way?

That’s the right way, kinda sorta

newlink is undefined, try newLink instead.

Thanks Mittineague. Sorry it took so long to thanks you. I was out for a couple days.