This method is for attaching rubber elastic to the leg hole of swimwear,
I use the three point zigzag, much better for attaching elastic, more stitch points and does not pull in form edges of the zigzag.
First, put a few stitches into just the elastic, and make sure you leave an extra inch behind the presser foot to hold onto the elastic, then with the needle down insert fabric under the elastic and line up with right edge fo elastic.
Using a three point zigzag of 4.5mm and stitch length of 1.8mm. Attach elastic to the fabric.
Then flip over and make sure elastic and fabric is tight to the edges, and topstitch over it making sure you catch the elastic. I use the lightning blot zigzag, you can also use a zigzag to topstitch.
Rubber elastic is my preferred elastic to use for swimwear but has to be ordered online (Ebay), not readily available locally anywhere.