Home · Business · IT, Data & Security · Software development

YES

As of 13 August 2026, AI can write JavaScript for your business website.

This still needs a person who signs their name to it.

Can you do it?

5 minutesto a draft.

30 minutesto something you’d act on.

Cost, all in£0

Skill neededpower-user

Who has to check ita colleague

What the alternative costsThe supplied tool data gives no price for a human developer or agency.

If this goes wrong, the code can break a customer journey, expose data or create an incorrect business transaction until someone finds and fixes it.

What to actually do

  1. Hand it to a person

    The route this page recommends

    A person who owns the outcome does this end to end, worth it when the failure is dear.

  2. Use a tool built for this

    Second choice
  3. Do it yourself

    The distant third

    A chat interface, power-user skill, and roughly 30 minutes until you can act on the result.

    How to actually do it

    1. Open the website editor or code repository and copy the relevant page HTML, CSS and existing JavaScript into a separate working document.
    2. Write down the feature's trigger, expected result, validation rules, API details and the browsers and devices the site must support.
    3. Remove passwords, API keys, customer details and other private data, then paste the remaining code and requirements into the prompt.
    4. Ask the model to produce the JavaScript, exact installation instructions and the test checklist without inventing missing platform or API details.
    5. Apply the code in a staging site or local copy rather than the live website, and run the checklist with valid, empty, invalid, repeated and slow-network inputs.
    6. Open the browser developer tools, check the Console and Network panels for errors or unexpected requests, and compare the behaviour with the stated business rules.
    7. Ask a developer or experienced colleague to inspect authentication, personal-data handling, API permissions and failure behaviour before publishing the change.
    8. Publish only after backing up the current site, confirming the feature works on the required mobile and desktop browsers, and recording how to remove or roll back the code.

    Prompt

    Write the JavaScript needed for this business website feature.
    
    Goal: [describe exactly what the visitor should be able to do]
    Website platform: [for example WordPress, Shopify, Webflow or custom HTML]
    Where the code will run: [page URL or page type]
    Existing HTML: [paste the relevant HTML]
    Existing CSS: [paste relevant CSS]
    Existing JavaScript: [paste relevant JavaScript]
    External services or APIs: [name them, or say none]
    Input and output data: [describe the fields, formats and expected results]
    Browser support: [list required browsers, or say modern desktop and mobile browsers]
    Security and privacy constraints: [describe personal data, payments, authentication or other sensitive areas, or say none]
    
    Return:
    1. The complete JavaScript, clearly separated into files or script blocks where needed.
    2. The exact HTML or CSS changes required.
    3. Exact instructions for where to place each part on this platform.
    4. A short explanation of the main logic and assumptions.
    5. A test checklist covering normal use, empty and invalid inputs, repeated clicks, slow network responses, mobile layout and API failures.
    6. A list of anything you cannot determine from the information provided.
    
    Do not invent API endpoints, credentials, fields, platform features or business rules. Do not include real secrets. If this feature handles payments, authentication or personal data, mark the security-sensitive parts and explain what a developer must review before launch.

    Open it prefilled in ChatGPT or Claude, or copy it into Gemini, which takes no prefill link.

What it gets wrong

  • AI cannot see your complete hosting, CMS, plugin and deployment setup unless you provide it, so its integration instructions can be wrong.
  • AI cannot establish that a third-party API, authentication flow or payment-related change is secure in your live environment.
  • AI cannot decide ambiguous business rules such as what should happen when a customer submits conflicting or incomplete information.
  • AI cannot take responsibility for downtime, lost leads, incorrect transactions or a personal-data incident caused by the code.
  • AI cannot replace browser, device, accessibility and regression testing against the rest of your website.

Even on a YES, the friction has a name: verification cost, judgement under ambiguity and stakes of error.

How we scored this

Five axes, each scored nought to two by hand: ten means AI carries the task cleanly, and the thresholds that turn a total into YES, PARTLY or NO are published in the methodology. Each axis name links to its definition.

AxisScore (0–2)
Output2
Inputs2
Verification1
Liability1
Effort delta2
Total8 / 10

FAQ

Can AI write JavaScript for my website?
Yes. It can draft common website features such as form validation, menus, calculators, filtering, API requests and interactive page elements. You still need to provide the surrounding code and test the result in a staging copy.
Can ChatGPT add a feature to my business website?
Yes, for a clearly described feature, it can produce code and explain where to put it. It cannot see your hosting and platform configuration unless you provide that context, so do not paste secrets and ask a developer to check security-sensitive changes.
Is AI-generated JavaScript safe for a business website?
It is not automatically safe. Test it away from the live site, inspect network requests and error handling, and get a developer to check authentication, payments and personal-data processing before launch.
How do I ask AI to write JavaScript for my website?
Give it the exact behaviour, platform, relevant HTML, CSS, existing JavaScript, API details and browser requirements. Ask for complete code, installation instructions, assumptions and tests, and tell it not to invent missing endpoints, credentials or business rules.

Nearby answers

Assessed by gpt-5.6-luna (gpt-5.6-luna) on 2026-08-13, second-checked by an independent model. Wrong somewhere? Email [email protected] and it gets re-checked.

The newsletter

AI news, new answers and product picks, straight to your inbox.