jQuery passe dynamique de la valeur de l'id de la fonction

Im nouveau à JS/jQuery.

J'ai eu ce code:

<button id="value1" class="buttonkontakte" onclick="kontakte()">KLICK1</button>
<button id="value2" class="buttonkontakte" onclick="kontakte()">KLICK2</button>
<button id="value3" class="buttonkontakte" onclick="kontakte()">KLICK3</button>

jQuery:

function kontakte(){
    var getthevalue = ???????????????;
    $.ajax({
        type: 'post',
        url: 'post.php',
        data: {wasmachen: "kontakte", value: getthevalue},
        success: function(msg) {
            $('#kontakte').html(msg);
        }
    });
}

Maintenant, quand je clique sur KLICK1 je veux passer "valeur1" pour le var getthevalue. Comment puis-je le faire?

InformationsquelleAutor user3047382 | 2014-09-02