led blinking with pushbutton

i want to blink a led with pushbutton, my code is

const int ledpin=13;

const int buttonpin=2;
int buttonstate=0;
void setup(){
pinMode(ledpin,OUTPUT);

pinMode(buttonpin,INPUT);
}
void loop(){

buttonstate=digitalRead(buttonpin);

if(buttonstate==HIGH){
digitalWrite(ledpin,HIGH);

delay(1000);
digitalWrite(ledpin,LOW);
}
else{
digitalWrite(ledpin,LOW);

}
}

why it is not working?

You haven't said what it does but if the LED comes on but doesn't flash that's because you need an extra delay AFTER it's switched off. Otherwise it's on, a second later it goes off then instantly goes back to the top of loop() and switches on again.

Otherwise perhaps the button is not connected correctly. How is it connected?

Steve

If the button is held down, the way its currently wired, does the LED illuminate?

Trouble is, you have not explained what you mean by "blink a LED with pushbutton".

Suggest you read the instructions for posting questions.