kiko
1
So I have an input stored as a variable.
let input = createInput();
Now, I want to remove the border that is created when you click on it.

I know that can be done in css with
input:focus{
outline:none;
}
So how can I change the outline property all in js? For now, I will just make a proper html/css object, that’s not what I’m looking for… Thanks
1 Like
kiko
3
That did not work, at least how I tried it. I am trying to set a property to the input:focus.
This is what I did.
input.attribute('outline', 'none');
Seems like the outer attribute is focus, while outline is its inner attribute. 
Dunno how to handle nested attribs. Maybe this might work. Worth a try: 
input.attribute('focus', 'outline:none');
or input.attribute('focus', '{ outline:none; }');
kiko
5
No, neither of those worked but thanks for the ideas!
Oh, forgot about style(): p5js.org/reference/#/p5.Element/style 
And if that fails, we can still access the underlying HTMLElement via elt: 
p5js.org/reference/#/p5.Element/elt
1 Like
kiko
7
Nope… wondering if this is even a thing in p5.
anyway the solution wasn’t very hard
<style>
input:focus {
outline: none;
}
</style>
2 Likes