Changing innerHtml trough p5

Is p5 capable of changing the innerHTML of an html element?I know that you can change the value trough select(#something).value(); but is there an equivalent to this function for changing innerHTML

1 Like

p5js.org/reference/#/p5.Element/html

Thanks for the reply but I am asking about a pre established html element that was not created in the p5 sketch, because I need to apply css to it

You have already answered that in your 1st post:

Function select() returns a [u]p5.Element[/u] wrapper for the searched Element:

Just switch [u]p5.Element[/u] method value() to html() this time.

1 Like

For CSS, I believe the p5.Element::style() method would be much more appropriate & practical:

1 Like

Thanks a lot for the quick answer ! Your suggestion solved my problem if you can call it one, it also cleared up a lot of the misunderstandings I had about the DOM manipulation.You were of great help and I really appriciate it. Keep up the great work

1 Like