I have a generic out of box web part page. I have added a content editor web part on that page that links to a HTML file because I want to build my own custom form via HTML.

Here is the HTML file.

<!DOCTYPE html>
        padding: 4px;
        margin: 1px;
    .field label{
        display: inline-block;
        width: 160px;
        margin-left: 5px;
    .field select{
        display: inline-block;
    <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js'></script>

            $("#ItemTypeSelect").append(new Option('test', 'test'));

    <div class="field">
        <label>Item Type:</label>
        <select id="ItemTypeSelect" name="ItemType"></select>
    <div class="field">
        <select name="Manufacturer"></select>
    <div class="field">
        <select name="Model"></select>
    <div class="field">
        <label>Serial Number(s):</label>
        <select multiple='multiple' name="SerialNumber"></select>


On page load, my scripts are not working, and I'm not receiving any runtime errors in the console. I have also tried adding a script editor to my page and put the scripts that you see above in the script editor and they are still not working without any errors in console.

How do I get scripts to work in an HTML file or script editor for a form inside a content editor?

  • Try adding breakpoint inside document.ready() and debug. See if gets the select element properly. Jan 8, 2019 at 15:52

1 Answer 1


You need to add type attribute to your script tag, like given below:

<script type="text/javascript">console.log('In.');</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.