Creating a NXT/Ardor transaction using the NXT api via post I read the following wiki on how to make a transaction:

http://wiki.nxtcrypto.org/wiki/The_Nxt_API#Create_Transaction_Request

But is there a sample code of how to make such a transaction using only html and javascript?
Sure, connect to any public node or your local node using http://localhost:7876/test and use the resulting API test page as example.