Election Widget
All of our services wrapped up in a free election lookup for your website
Our embeddable widget helps voters find their election information. The embedding process is as simple as copying and pasting some code, and does not require a web developer.
Features include:
- Search by postcode polling station finder
- Optional Welsh language support
- Optional candidate information
- Responsive design
- Mobile friendly
- Accessible
- Free to use, but not to maintain. Please consider a donation to help us keep this service running.
We'd love you to use our election widget on your web site. If you do, we kindly ask that you:
- Let us know you're using it. We don't limit use, but it's great to know who has used the embed feature.
- Give us feedback either from your users or yourselves. We want to learn and iterate, and we can't do that without feedback!
First, choose from the options below and hit ‘Generate’.
Second, use the code to embed the widget in your website.
<noscript>
<a href="https://whocanivotefor.co.uk">Find election information at
<span aria-label="Who Can I Vote For">WhoCanIVoteFor.co.uk</span></a>
</noscript>
<div id="dc_wdiv" aria-live="polite" role="region"></div>
<script type="text/javascript"
src="https://widget.wheredoivote.co.uk/wdiv.js">
</script>
Pre-populating a postcode
If you already know the user's postcode, you can render the widget div with the postcode
pre-populated by adding a data-postcode
attribute to the
<div id="dc_wdiv">
.
This will take the user straight to their results (or an address picker).
For example:
<div
id="dc_wdiv"
data-postcode="SW1A 1AA"
aria-live="polite"
role="region"
>
</div>
This allows you to show election information in a context where you've already collected the user's postcode without requiring the user to perform two searches.