Connect this jumper wire back to the switch terminal. Here is a picture gallery about how to wire a plug and switch diagram complete with the description of the image please find the image you need.
Wiring A 2 Way Switch Home Electrical Wiring Diy
How to wire a light switch to a plug. Install a new black wire to the bottom wire screw on the switch located beneath the top connection just made. When they are secure screw on a wire nut being sure that all exposed wire is covered by the nut. Hold the ends of the white wires of the cord and light fixture together so they are parallel and twist them clockwise with the pliers. The red wire would be used as the switched leg back up to the vanity light where it would be connected to the black wire of the vanity light. My light fixture had 2 wires one black and one white wire. Now remove the wire cap from the two white wires in the box add the white wire from the outlet and reset the cap.
Your switch may have slots to push the wires straight into place rather than use the screws on the side. Repeat with the black wires. Remove the black line wire from the switch twist it together with the black wire going to the receptacle and add a six inch length of black wire of the same gauge. Connect the wires of the light fixture to the extension cord wires. Usually if you are wiring a regular fixture you match the black to black wires and white to white but in this case my extension cord came with two white wrapped wires so i didnt have that colour guidance. The black and white would be used for the power for the outlet and the vanity light switch.
For extra safety and security wrap electrical tape around the connection. The black wire should be installed at the top wire screw on the back side of the switch. Some switches will have slots that you can slide a straight wire into and tighten it down with the screw which is definitely easier than wrapping the hooked wire around the screw. Connect the black wire coming from the light fixture not the hot wire to either one of the black screws on the switchit doesnt matter in this case. The wire strippers should have a spot marked for each gauge wire. Install a 3 wire cable of the same wire gauge from the vanity light to the wall switch.
These will be the only wires connected to the switch. Next bend the wire into a pig tail loop so that you can easily attach to the screws on the light switch. Connect the black incoming wire to the switch to be installed in the circuit using the screwdriver. Wiring diagrams for switch to control a wall receptacle do it with regard to how to wire a plug and switch diagram image size 500 x 328 px and to view image details please click the image.