Question

I have inserted into my Home.aspx a list with Web-Parts like this:

enter image description here

Now I want to know how can I apply JavaScript to this list?

Note: I want to display an image depending of selected of one field

Was it helpful?

Solution

You can apply JavaScript to your list by using Script Editor Web-part(SEWP)

enter image description here

Step 1: Edit the list page from top right gear/edit page.

Step 2: Add new web part and add a Script Editor to the page, under Media and Content.

Step 3: Add your JavaScript code.

OTHER TIPS

Your screenshot looks like the Classic view. For this view you can use Client Side Rendering (JS Link) either for the field itself or for a List View Web Part (on a classic page).

In a modern view, you'll need to use a SharePoint Framework Field Customizer. However, these are still in preview and likely won't be available outside of developer tenants until the end of September or later.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top