How to sign ant transaction to generate Byte Encoded data?

How do I sign any transaction. Currently using JavaScript SDK for ALGO. The function sendRawTransaction requires byte encoded data for transaction.

How can I create it?

Here is a link to the sample web app that comes with the SDK. Take a look at the section around line 128 on the submit transaction code an LMK if this answers your question.

I am finding signing transaction for JavaScript.
But now I’ve got signTransaction algod method.