Can I change TITLE and H1 with javascript? Or is it a big risk for SEO?

I have a special case: People can search for european sizes, say 70, but the american counterpart is 32.

Now my title is “70 – Something something in size 70”
But I want it “70 / 32 – Something something in size 70 / 32”

For now I can’t make it server size. But I would like to do this via Javascript until I can do it server side.