# Needed helps on html button to trigger a function

**URL:** <https://community.particle.io/t/needed-helps-on-html-button-to-trigger-a-function/45202>\
**Category:** Getting Started\
**Created:** [November 13, 2018, 2:50am UTC](https://community.particle.io/t/needed-helps-on-html-button-to-trigger-a-function/45202 "2018-11-13T02:50:46Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [November 13, 2018, 3:25am UTC](https://community.particle.io/t/needed-helps-on-html-button-to-trigger-a-function/45202/2 "2018-11-13T03:25:48Z")

</div>

Hi @Genius

Please take a look at this (older) tutorial, particularly the HTML/Javascript part.

> [@Tutorial: Spark Variable and Function on One Web Page](https://community.particle.io/t/tutorial-spark-variable-and-function-on-one-web-page/4181):
>
> Let’s say you have a Spark core with both a Spark variable and a Spark function. In my case, I have the world’s simplest servo control sketch, using the nice miniature servo in the Spark Maker Kit. Using these parts, we will build a servo that you can control from a web page anywhere and monitor the position of the servo too! Here’s a preview of the finished tutorial: [image] There is a coarse adjust slider, two fine adjust buttons, and the current position of the servo is displayed. That…

First off, you probably need to load JQuery to use `$.post`.

Second, your URL format is not correct for a POST request to call a function. You should have just the function name "led" at the end of the URL. You are already passing the access\_token in the parameters.

---

_[View the full topic](https://community.particle.io/t/needed-helps-on-html-button-to-trigger-a-function/45202)._
