I can set the width of an <input type=number> field with CSS width = 6em; or width = 100%, but those only set a fixed width or a width that varies with the container. I want the width to depend on how big the number is that I've typed in.
I'm sure I can do this with JavaScript by setting width = 100% and writing the <input>'s value in the containing element (hidden somehow). But is there a way to do this without JavaScript at all? Pure CSS? I'm able to use the absolute latest bleeding-edge CSS features.
attr()directive, but support for that outside of thecontentproperty is basically 0. Even if you could read thevalueattribute of the field in this way, I don't believe that attribute updates when you modify the field.