To Set a Lookup Value using JavaScript on Power Pages you can follow below steps to achieve this functionality .
Step 1) Create a list and pass id as ID Query String Parameter in your list form.
By passing id you will basically be sending the current record id to the next form.

In the same list form under Option tab add button and select TargetType as “WebPage” and mention Redirect to Webpage column with the WebPage that we will create in below step (5) .

Step 2) Clear your portal Cache and view the result you will able to see the list and by clicking on the item actions you will able to see ADD INCIDENT button which will direct to another page as shown in below screenshot.

Step 3) Create a Web template with below code in order to set lookup value.
To set lookup value currently we are only having id that we passed in above step (1) , we will retrieve name using that id in order to set the lookup value as we need id, name to set lookup value.
Save this web template.

{% assign account= request.params['id'] %}
<div class="container" style="margin:100px">
{% fetchxml accountlist %}
<fetch version="1.0" output-format="xml-platform" mapping="logical" no-lock="false" distinct="true">
<entity name="account">
<attribute name="entityimage_url"/>
<attribute name="name"/>
<filter type="and">
<condition attribute="statecode" operator="eq" value="0"/>
<condition attribute="accountid" operator="eq" value="{{ account }}" />
</filter>
</entity>
</fetch>
{% endfetchxml %}
{% for result in accountlist.results.entities %}
<script>
$(document).ready(function() {
$("#customerid_name").attr("value","{{result.name}}");
$("#customerid").attr("value","{{result.accountid}}");
$("#customerid_entityname").attr("value","account");
});
</script>
{% endfor %}
Step 4) Create a Page Template and add the above web template that we created in step (3) as shown in below screen shot.

Step 5) Create a Web pages and add the Page template that we created in above step and your Basic or Multistep Form into it as shown in below screenshot.
In my case I have Multistep form.

Clear your portal cache and view the result.
When you will click on ADD INCIDENT button it will redirect to another webpage where you will find the lookup value that is already been set.

Hope this helps!!!
If you find this solution helpful, please mark it as accepted solution.