If you keep your console open you will see the error.
Your function is named setPinnedPositionItemToLocalStorage()
(camelCase) but you are setting the click handler for it by saying onclick="SetPinnedPositionItemToLocalStorage()"
(PascalCase). They must be consistent, as Javascript is case-sensitive.
CLICK HERE to find out more related problems solutions.